E
Earl Teigrob
I am having a problem converting Sql data types to .Net value types
for example, the following code
SqlDateTime sd = new SqlDateTime(2004,2,2);
DateTime d;
d=Convert.ToDateTime(sd);
produces this error message
Specified cast is not valid.
The microsoft help to convert SqlDateTime to DateTime for C# shows the code
below but I am not sure how to use this to do a conversion
[C#]
public static explicit operator DateTime(
SqlDateTime x
);
Does anyone have an example for doing this?
Thank you
Earl
for example, the following code
SqlDateTime sd = new SqlDateTime(2004,2,2);
DateTime d;
d=Convert.ToDateTime(sd);
produces this error message
Specified cast is not valid.
The microsoft help to convert SqlDateTime to DateTime for C# shows the code
below but I am not sure how to use this to do a conversion
[C#]
public static explicit operator DateTime(
SqlDateTime x
);
Does anyone have an example for doing this?
Thank you
Earl