Click here to Skip to main content
16,017,899 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to cancel BindingNavigator event. Pin
c0ax_lx23-Oct-07 23:52
c0ax_lx23-Oct-07 23:52 
GeneralRe: How to cancel BindingNavigator event. Pin
azifaliazif24-Oct-07 0:15
azifaliazif24-Oct-07 0:15 
AnswerRe: How to cancel BindingNavigator event. Pin
azifaliazif24-Oct-07 23:11
azifaliazif24-Oct-07 23:11 
QuestionDateTime insert SQL Query in C# Pin
dataminers23-Oct-07 23:22
dataminers23-Oct-07 23:22 
AnswerRe: DateTime insert SQL Query in C# Pin
Christian Graus23-Oct-07 23:30
protectorChristian Graus23-Oct-07 23:30 
GeneralRe: DateTime insert SQL Query in C# Pin
Guffa23-Oct-07 23:54
Guffa23-Oct-07 23:54 
AnswerRe: DateTime insert SQL Query in C# Pin
Colin Angus Mackay23-Oct-07 23:36
Colin Angus Mackay23-Oct-07 23:36 
AnswerRe: DateTime insert SQL Query in C# Pin
Guffa24-Oct-07 0:08
Guffa24-Oct-07 0:08 
An Access database uses # around a date literal, MS SQL uses apostrophes. No database (to my knowledge) uses both.

For an Access database, the correct syntax would be:

...<br />
sql += message + "',#";<br />
sql += currentTime + "#)";


For an MS SQL database, the correct syntax is:

...<br />
sql += message + "','";<br />
sql += currentTime + "')";


However, I fully agree with the other posters that you should use a parameterised query. It both solves problem with date formats and the problem with SQL injection vonurability that you get when putting the values in the query without encoding them properly.

---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams

Questionhow get data from database [modified] Pin
alok217123-Oct-07 23:05
alok217123-Oct-07 23:05 
AnswerRe: how get data into drop down box from database Pin
pmarfleet23-Oct-07 23:11
pmarfleet23-Oct-07 23:11 
Questionproperty grid Pin
sindhutiwari23-Oct-07 22:47
sindhutiwari23-Oct-07 22:47 
AnswerRe: property grid Pin
Christian Graus23-Oct-07 23:03
protectorChristian Graus23-Oct-07 23:03 
GeneralRe: property grid Pin
sindhutiwari23-Oct-07 23:07
sindhutiwari23-Oct-07 23:07 
GeneralRe: property grid Pin
Christian Graus23-Oct-07 23:28
protectorChristian Graus23-Oct-07 23:28 
QuestionUse window application in Web Application Pin
Sun Rays23-Oct-07 22:46
Sun Rays23-Oct-07 22:46 
AnswerRe: Use window application in Web Application Pin
Christian Graus23-Oct-07 22:50
protectorChristian Graus23-Oct-07 22:50 
GeneralRe: Use window application in Web Application Pin
c0ax_lx23-Oct-07 23:19
c0ax_lx23-Oct-07 23:19 
AnswerRe: Use window application in Web Application Pin
Paddy Boyd24-Oct-07 1:00
Paddy Boyd24-Oct-07 1:00 
Questionmultiple forms Pin
kabutar23-Oct-07 22:41
kabutar23-Oct-07 22:41 
AnswerRe: multiple forms Pin
Stefan Troschuetz23-Oct-07 22:44
Stefan Troschuetz23-Oct-07 22:44 
AnswerRe: multiple forms Pin
Christian Graus23-Oct-07 22:51
protectorChristian Graus23-Oct-07 22:51 
GeneralRe: multiple forms Pin
kabutar23-Oct-07 22:58
kabutar23-Oct-07 22:58 
AnswerRe: multiple forms Pin
Spunky Coder23-Oct-07 22:52
Spunky Coder23-Oct-07 22:52 
GeneralRe: multiple forms Pin
kabutar23-Oct-07 22:56
kabutar23-Oct-07 22:56 
GeneralRe: multiple forms Pin
Christian Graus23-Oct-07 23:02
protectorChristian Graus23-Oct-07 23:02 

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.