>I can't figure out how to convert datetime field from Microsoft SQL Server into a C# DateTime object. I have found the DateTime.Parse and DateTime.ParseExact methods, but can't really figure out IFormatProvider. Once I have the string from Microsoft SQL, I would expect that, since it was a commonly used format, there would be an easy way, I just can't find it.
>
>(I just want to dump the datum from the database into a DateTime object. I don't have to worry about formatting it's output now.)
David,
Do you mean that the field in your SQL Server table is varchar? If it is DateTime, the SQL ADO.NET provider performs the conversion automatically.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement