Click here to Skip to main content
15,889,931 members
Home / Discussions / Database
   

Database

 
GeneralRe: variable queries for vb.net Pin
Colin Angus Mackay25-Jun-05 2:38
Colin Angus Mackay25-Jun-05 2:38 
GeneralRe: variable queries for vb.net Pin
WetRivrRat27-Jun-05 2:40
WetRivrRat27-Jun-05 2:40 
Generalhello,sqldatabase registering error Pin
Anonymous24-Jun-05 10:53
Anonymous24-Jun-05 10:53 
GeneralRe: hello,sqldatabase registering error Pin
NeverHeardOfMe24-Jun-05 12:25
NeverHeardOfMe24-Jun-05 12:25 
GeneralRe: hello,sqldatabase registering error Pin
Anonymous24-Jun-05 21:33
Anonymous24-Jun-05 21:33 
Questionbind parameter in a datagrid's column ? Pin
newprog24-Jun-05 2:30
newprog24-Jun-05 2:30 
GeneralSQL Datetime - Independent Format Pin
Seraphin24-Jun-05 0:38
Seraphin24-Jun-05 0:38 
GeneralRe: SQL Datetime - Independent Format Pin
Colin Angus Mackay24-Jun-05 3:42
Colin Angus Mackay24-Jun-05 3:42 
Seraphin wrote:
A big problem is a Datetime object in the CommandText property.

Why are you putting a DateTime in the CommandText property?

Seraphin wrote:
Is .NET unable to convert Datetime object into the right SQL Server system format?

.NET is perfectly capbable of converting a DateTime object to what ever format you wish in multiple calendars (should you so wish it).


Seraphin wrote:
how to solve it?

If you need to use a DataTime (or anything else for that matter) in a query you should use parameters. This reduces the possibility of security holes.
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT * FROM MyTable WHERE SomeDate > @theDate";
cmd.Parameters.Add("@theDate", myDateTimeObject);


Does this help?


My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: SQL Datetime - Independent Format Pin
Seraphin25-Jun-05 3:44
Seraphin25-Jun-05 3:44 
GeneralDateTime datatype Pin
Blue_Skye23-Jun-05 18:09
Blue_Skye23-Jun-05 18:09 
GeneralRe: DateTime datatype Pin
Colin Angus Mackay23-Jun-05 21:06
Colin Angus Mackay23-Jun-05 21:06 
GeneralRe: DateTime datatype Pin
Yulianto.23-Jun-05 21:29
Yulianto.23-Jun-05 21:29 
GeneralRe: DateTime datatype Pin
Colin Angus Mackay23-Jun-05 23:07
Colin Angus Mackay23-Jun-05 23:07 
GeneralRe: DateTime datatype Pin
Yulianto.24-Jun-05 16:18
Yulianto.24-Jun-05 16:18 
GeneralRe: DateTime datatype Pin
Blue_Skye24-Jun-05 18:59
Blue_Skye24-Jun-05 18:59 
GeneralRe: DateTime datatype Pin
Colin Angus Mackay24-Jun-05 21:31
Colin Angus Mackay24-Jun-05 21:31 
GeneralRe: DateTime datatype Pin
Colin Angus Mackay24-Jun-05 21:28
Colin Angus Mackay24-Jun-05 21:28 
GeneralParameterized query Pin
csylesh23-Jun-05 6:43
csylesh23-Jun-05 6:43 
GeneralRe: Parameterized query Pin
Javier Lozano23-Jun-05 16:59
Javier Lozano23-Jun-05 16:59 
GeneralRe: Parameterized query Pin
Colin Angus Mackay23-Jun-05 21:09
Colin Angus Mackay23-Jun-05 21:09 
GeneralRe: Parameterized query Pin
csylesh24-Jun-05 7:56
csylesh24-Jun-05 7:56 
GeneralRe: Parameterized query Pin
Colin Angus Mackay24-Jun-05 8:04
Colin Angus Mackay24-Jun-05 8:04 
GeneralRe: Parameterized query Pin
csylesh27-Jun-05 6:33
csylesh27-Jun-05 6:33 
GeneralUnderstanding of Execution Plan????? Pls help me out!! Pin
under281123-Jun-05 3:54
under281123-Jun-05 3:54 
GeneralRe: Understanding of Execution Plan????? Pls help me out!! Pin
Colin Angus Mackay23-Jun-05 4:26
Colin Angus Mackay23-Jun-05 4:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.