Click here to Skip to main content
15,896,442 members
Home / Discussions / C#
   

C#

 
QuestionWhich PictureBox Array was clicked? [modified] Pin
FoxholeWilly25-May-06 8:55
FoxholeWilly25-May-06 8:55 
AnswerRe: Which PictureBox Array was clicked? Pin
Michael Potter25-May-06 9:00
Michael Potter25-May-06 9:00 
GeneralRe: Which PictureBox Array was clicked? Pin
FoxholeWilly25-May-06 9:18
FoxholeWilly25-May-06 9:18 
QuestionC Sharp- misnomer? Pin
FeedScrn25-May-06 8:33
FeedScrn25-May-06 8:33 
AnswerRe: C Sharp- misnomer? Pin
Josh Smith25-May-06 8:54
Josh Smith25-May-06 8:54 
GeneralRe: C Sharp- misnomer? Pin
FeedScrn10-Apr-14 13:51
FeedScrn10-Apr-14 13:51 
QuestionSql Datetime Pin
JelleM25-May-06 8:23
JelleM25-May-06 8:23 
AnswerRe: Sql Datetime Pin
Arjan Einbu25-May-06 9:09
Arjan Einbu25-May-06 9:09 
Have you had a look at at the actual SQL string produced by your string concatenation? I'm guessing there's a format mismatch, maybe due to some regional settings or something. (Often a problem when putting datetimes into the db like this.)

A safe and easy way to fix this would be to use parameters in your SQL query:
string query = @"
	INSERT INTO orders (date,customerid,productid,sum)
	VALUES (@date, @customerid, @sum)
	";
SqlCommand cmd = new SqlCommand(query, con);
cmd.Parameters.Add("@date", DateTime.Now);
cmd.Parameters.Add("@customerid", customerid);
cmd.Parameters.Add("@sum", sum);
cmd.ExecuteNonScalar();

GeneralRe: Sql Datetime Pin
JelleM25-May-06 9:26
JelleM25-May-06 9:26 
AnswerRe: Sql Datetime Pin
Michael Potter25-May-06 9:21
Michael Potter25-May-06 9:21 
GeneralRe: Sql Datetime Pin
User 665825-May-06 9:48
User 665825-May-06 9:48 
QuestionAdding function's description Pin
zaigham_chaudhry25-May-06 8:01
zaigham_chaudhry25-May-06 8:01 
AnswerRe: Adding function's description Pin
Paul Brower25-May-06 8:32
Paul Brower25-May-06 8:32 
AnswerRe: Adding function's description [modified] Pin
Josh Smith25-May-06 8:47
Josh Smith25-May-06 8:47 
GeneralRe: Adding function's description [modified] Pin
Paul Brower25-May-06 10:48
Paul Brower25-May-06 10:48 
GeneralRe: Adding function's description [modified] Pin
Josh Smith26-May-06 9:35
Josh Smith26-May-06 9:35 
Questionaborting a loop using button Pin
Maxicatten25-May-06 7:23
Maxicatten25-May-06 7:23 
AnswerRe: aborting a loop using button Pin
Judah Gabriel Himango25-May-06 7:47
sponsorJudah Gabriel Himango25-May-06 7:47 
QuestionDataSet Merge and Database Update Pin
sonicsqwirl25-May-06 6:04
sonicsqwirl25-May-06 6:04 
QuestionLogin system help? Pin
eric_tran25-May-06 5:32
eric_tran25-May-06 5:32 
AnswerRe: Login system help? Pin
J4amieC25-May-06 5:56
J4amieC25-May-06 5:56 
Questioncant dispose of webbrowser obj after print???? Pin
dpietro25-May-06 5:31
dpietro25-May-06 5:31 
Questionsurvey software Pin
ap_sa25-May-06 4:59
ap_sa25-May-06 4:59 
AnswerRe: survey software Pin
led mike25-May-06 5:55
led mike25-May-06 5:55 
QuestionDate Time Query Pin
kiran@nt525-May-06 4:55
kiran@nt525-May-06 4:55 

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.