Donate

How To Insert Date Object In MySQL Using C#.NET

Hello,

To insert date object using C#.net in MySQL db,use the code below:
  string query = String.Format("Insert into tbllistings(DateRegistered)"  
   + "values(DATE_FORMAT({0}, '%Y-%m-%d %h:%m:%s'))",objJobs.DateRegistered); 

The key to the solution is using the MySQL Date format function.

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input