Click here to Skip to main content
15,905,912 members
Home / Discussions / C#
   

C#

 
AnswerRe: virtual application root in javascript? what's the "~" in js?? Pin
lsugirljte31-May-06 4:33
lsugirljte31-May-06 4:33 
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 
Hello,

I am using the following piece of code to save data to my database:
<br />
SqlDateTime date = DateTime.Now; <br />
SqlCommand myCommand2 = new SqlCommand("INSERT INTO orders (date,customerid,productid,sum) VALUES ('" + date + "'," + index + ",'" + productid + "','" + aantal + "')", connect); <br />
myCommand2.ExecuteScalar();<br />

the date-field in the database has the property datetime.
When i try to run the query, he always gives following error:
<br />
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.rnThe statement has been terminated.<br />

I tried to use DateTime.Now directly in the query, but it still gives the same error, also writing a date by hand (in the values-field in the query) gives an error.
When I write a date (exactly the same format as the one above) directly in the database (without a query), i have no errors what so ever.
Can somebody help?
Thanks!
AnswerRe: Sql Datetime Pin
Arjan Einbu25-May-06 9:09
Arjan Einbu25-May-06 9:09 
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 

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.