Table Adapter Update to SQLServer - DateTime column truncation RRS feed

  • Question

  • I have a strongly typed c# dataset (.Net 4) that has a DataTable with System.DateTime columns in it. When I add rows to this DataTable and use the table adapter Update() to commit the changes to SQLServer 2008, I get the date column values as truncated (i.e. lose the hh:mm:ss).

    The SQLServer time table columns are defined as 'datetime'. I examine the contents of the DataSet in the DEBUGGER before the Update() and I see the FULL DATE (including hh:mm:ss).  I also looked in the XSD and sure enough, all the columns are in fact System.DateTime.

    Any thoughts anyone?

    Thanks for the help.

    Wednesday, July 13, 2011 3:13 AM


  • Check out how is TableAdapter configured (it is a code generated by a tool).
    Miha Markic [MVP C#]
    Wednesday, July 13, 2011 12:07 PM

All replies