S
SenseiHitokiri
I learned today that an insert statement I am generating out of a
DataSet which gets populated straight from SqlDataReaders is not giving
me the same precision that it is stored in the database with.
Table 1 (Origin table)
Nov 8 2006 5:19:10:617PM
is being stored as
Table 2 (Destination Table)
Nov 8 2006 5:19:10:000PM
because the insert looks like
SET [CREATE_DATE]='11/8/2006 5:19:10 PM'
When I am reading from Table 1 into the Dataset and displaying it in a
DataGridView it shows up as 11/8/2006 5:19 PM. So then when I try to
write an insert string for a SqlCommand object I just try to append the
field from the DataSet. The insert string is generated like this
[CREATE_DATE]='11/8/2006 5:19:10 PM'. Is there a way to get my dataset
to handle this precision on it's own? I don't want to write methods
that will parse the string for the word date and I don't want to create
a library of table columns because that may run into it's own problems.
So basically I'm left with two options in my eyes: Figure out how to
get the dataset to realize the columns precision or Write a method to
determine the column's type and then apply the proper formatting to the
string.
DataSet which gets populated straight from SqlDataReaders is not giving
me the same precision that it is stored in the database with.
Table 1 (Origin table)
Nov 8 2006 5:19:10:617PM
is being stored as
Table 2 (Destination Table)
Nov 8 2006 5:19:10:000PM
because the insert looks like
SET [CREATE_DATE]='11/8/2006 5:19:10 PM'
When I am reading from Table 1 into the Dataset and displaying it in a
DataGridView it shows up as 11/8/2006 5:19 PM. So then when I try to
write an insert string for a SqlCommand object I just try to append the
field from the DataSet. The insert string is generated like this
[CREATE_DATE]='11/8/2006 5:19:10 PM'. Is there a way to get my dataset
to handle this precision on it's own? I don't want to write methods
that will parse the string for the word date and I don't want to create
a library of table columns because that may run into it's own problems.
So basically I'm left with two options in my eyes: Figure out how to
get the dataset to realize the columns precision or Write a method to
determine the column's type and then apply the proper formatting to the
string.