M
Manikandan
Hi,
I need to insert the datetime with milliseconds value into a datarow.
My code as below
DataTable testDataTable=new DataTable();
testDataTable.Columns.Add("updatedDateTime", typeof(DateTime));
DataRow testDateRow=surveyUpdatedDateDataTable.NewRow();
testDateRow["updatedDateTime"]=DateTime.Now.ToString("yyyy-MM-dd
HH:mm:ss.fff");
testDataTable.Rows.Add(surveyUpdateDateRow);
when I read the values back using the following code I lose the
millisecond value
for(int testRows=0;testRows<testDataTable.Rows.Count;testRows++)
{
Messagebox.Show(testDataTable.Rows[testRows]
["updatedDateTime"] .ToString()
}
Any conversion required?
When i give a messagebox for DateTime.Now.ToString("yyyy-MM-dd
HH:mm:ss.fff") it is coming properly with milliseconds
I need the datetime values with milliseconds from datatable to insert
into sql server datetime column
Thanks,
Mani
I need to insert the datetime with milliseconds value into a datarow.
My code as below
DataTable testDataTable=new DataTable();
testDataTable.Columns.Add("updatedDateTime", typeof(DateTime));
DataRow testDateRow=surveyUpdatedDateDataTable.NewRow();
testDateRow["updatedDateTime"]=DateTime.Now.ToString("yyyy-MM-dd
HH:mm:ss.fff");
testDataTable.Rows.Add(surveyUpdateDateRow);
when I read the values back using the following code I lose the
millisecond value
for(int testRows=0;testRows<testDataTable.Rows.Count;testRows++)
{
Messagebox.Show(testDataTable.Rows[testRows]
["updatedDateTime"] .ToString()
}
Any conversion required?
When i give a messagebox for DateTime.Now.ToString("yyyy-MM-dd
HH:mm:ss.fff") it is coming properly with milliseconds
I need the datetime values with milliseconds from datatable to insert
into sql server datetime column
Thanks,
Mani