Click here to Skip to main content
15,850,359 members
Home / Discussions / C#
   

C#

 
Questionproblem receiving data from Pin
Shivendra Pandey17-Dec-09 3:14
Shivendra Pandey17-Dec-09 3:14 
AnswerRe: problem receiving data from Pin
OriginalGriff17-Dec-09 3:35
mveOriginalGriff17-Dec-09 3:35 
AnswerRe: problem receiving data from Pin
Migounette17-Dec-09 4:59
Migounette17-Dec-09 4:59 
AnswerRe: problem receiving data from Pin
Jim Crafton17-Dec-09 6:37
Jim Crafton17-Dec-09 6:37 
QuestionCreate an Insert SQL - Statement for insert a date Pin
neus8317-Dec-09 2:59
neus8317-Dec-09 2:59 
AnswerRe: Create an Insert SQL - Statement for insert a date Pin
Arindam Tewary17-Dec-09 3:15
professionalArindam Tewary17-Dec-09 3:15 
AnswerRe: Create an Insert SQL - Statement for insert a date Pin
Shivendra Pandey17-Dec-09 3:17
Shivendra Pandey17-Dec-09 3:17 
AnswerRe: Create an Insert SQL - Statement for insert a date [modified] Pin
OriginalGriff17-Dec-09 3:33
mveOriginalGriff17-Dec-09 3:33 
OK, there are a few problems here. Do it this way:
SqlCommand dataCommand = new SqlCommand("INSERT INTO table1 (Text,Datum) VALUES (@TX,@DT)");
dataCommand.Parameters.AddWithValue("@TX", "Info");
dataCommand.Parameters.AddWithValue("@DT", TimeForTheDatabase);

That way you won't get the syntax error, and you can start to avoid SQL injection attacks later on.

[edit]I forgot the .Parameters bit. D'Oh! | :doh: [/edit]

All those who believe in psycho kinesis, raise my hand.

modified on Thursday, December 17, 2009 10:07 AM

GeneralRe: Create an Insert SQL - Statement for insert a date Pin
loyal ginger17-Dec-09 5:05
loyal ginger17-Dec-09 5:05 
GeneralRe: Create an Insert SQL - Statement for insert a date Pin
OriginalGriff17-Dec-09 5:09
mveOriginalGriff17-Dec-09 5:09 
AnswerRe: Create an Insert SQL - Statement for insert a date Pin
cysccnu17-Dec-09 4:34
cysccnu17-Dec-09 4:34 
GeneralRe: Create an Insert SQL - Statement for insert a date Pin
PIEBALDconsult17-Dec-09 6:07
mvePIEBALDconsult17-Dec-09 6:07 
GeneralRe: Create an Insert SQL - Statement for insert a date Pin
OriginalGriff17-Dec-09 6:18
mveOriginalGriff17-Dec-09 6:18 
GeneralRe: Create an Insert SQL - Statement for insert a date Pin
PIEBALDconsult17-Dec-09 9:21
mvePIEBALDconsult17-Dec-09 9:21 
QuestionInjection Games Menu. Pin
evangile17-Dec-09 2:36
evangile17-Dec-09 2:36 
AnswerRe: Injection Games Menu. Pin
Eddy Vluggen17-Dec-09 3:34
professionalEddy Vluggen17-Dec-09 3:34 
GeneralRe: Injection Games Menu. Pin
evangile17-Dec-09 4:34
evangile17-Dec-09 4:34 
GeneralRe: Injection Games Menu. Pin
Eddy Vluggen17-Dec-09 4:40
professionalEddy Vluggen17-Dec-09 4:40 
AnswerRe: Injection Games Menu. Pin
EliottA17-Dec-09 4:01
EliottA17-Dec-09 4:01 
GeneralRe: Injection Games Menu. Pin
evangile17-Dec-09 4:28
evangile17-Dec-09 4:28 
GeneralRe: Injection Games Menu. Pin
EliottA17-Dec-09 4:31
EliottA17-Dec-09 4:31 
GeneralRe: Injection Games Menu. Pin
evangile17-Dec-09 4:36
evangile17-Dec-09 4:36 
QuestionHow to convert List to datatable Pin
NK717-Dec-09 1:48
NK717-Dec-09 1:48 
AnswerRe: How to convert List to datatable Pin
Ashfield17-Dec-09 2:11
Ashfield17-Dec-09 2:11 
GeneralRe: How to convert List to datatable Pin
Paulo Zemek17-Dec-09 2:28
mvaPaulo Zemek17-Dec-09 2:28 

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.