Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting DateTime from one culture to another
Message
De
15/04/2005 16:50:39
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01004901
Message ID:
01005338
Vues:
18
Hi,

The display of the data columns are being shown in the correct culture (The DataGrid seems to do that automatically). My problem was getting a date taken from a DateTimePicker to be in the correct culture so I could use it in a WHERE clause.

I figured out that I can use a parameterised SQL statement like "WHERE SOMEDATE BETWEEN @SomeDateFrom AND @SomeDateTo" and use IDbDataParameter to populate the parameters (I used to build the WHERE clause so that it was passed to the DB with hardcoded values from variables but this means the DB has to recalculate the execution path every time and it did not work properly with dates of different cultures). It seems it does not matter what the culture of the DateTime that is used to create the IDbDataParameter parameter is when done this way.

Thanks for your reply,

Andrew
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform