Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving a datetime field form a CE database table
Message
De
04/06/2007 12:33:29
 
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01229763
Message ID:
01230285
Vues:
19
I'm surprised that doesn't work (although I've not used SqlServerCe, it may be quirky). Have you tried using a SqlDataAdapter and filling a DataSet or DataTable? I'm just curious as to whether you'd have the same problem doing it that way.

~~Bonnie


>Hi,
>
>I'm trying to retrieve a datetime field from a WinCE database table using the following code:
>
>DateTime LupdDate;
>
>System.Data.SqlServerCe.SqlCeCommand sqlCeCommand2 = new
>System.Data.SqlServerCe.SqlCeCommand("select LupdDate from Product where prodid =12036",SqlCeProvider.Connection);
>
>sqlCeCommand2.Connection.Open();
>
>LupdDate = (DateTime)sqlCeCommand2.ExecuteScalar();
>
>The problem is that I only get the date part of the datetime.
>
>Any ideas why ?
>
>Best regards,
>Hans
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform