Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrong Default language
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01163250
Message ID:
01163527
Views:
10
Hi Pete,

As Borislav has suggested, you might try to convert the date entered by the user to the corresponding ANSI format which SQL Server will understand no matter what dateformat is configured on the connection. You can always take advantage of the Fotmat Patterns supported by the various overloads of the ToString() method of the DateTime class. Please, see how the following code converts a date stored in a variable of the type DateTime to a string conforming to the ANSI format:
DateTime today = DateTime.Today;

string ansiDateRepresentation = today.ToString("yyyyMMdd HH:mm:ss");

Console.WriteLine(ansiDateRepresentation);  // 20061019 00:00:00
HTH.
-----
Fabio Vazquez
http://www.fabiovazquez.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform