Click here to Skip to main content
15,922,574 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sql multiple queries [modified] Pin
JelleM26-May-06 0:45
JelleM26-May-06 0:45 
AnswerRe: Sql multiple queries [modified] Pin
Arjan Einbu25-May-06 12:42
Arjan Einbu25-May-06 12:42 
QuestionResizing in designer wont take effect when running. Pin
RanvA25-May-06 10:14
RanvA25-May-06 10:14 
AnswerRe: Resizing in designer wont take effect when running. Pin
alexey N25-May-06 18:12
alexey N25-May-06 18:12 
QuestionGet information about an extended control (IExtenderProvider) Pin
giplet25-May-06 9:14
giplet25-May-06 9:14 
AnswerRe: Get information about an extended control (IExtenderProvider) Pin
Ed.Poore25-May-06 9:53
Ed.Poore25-May-06 9:53 
GeneralRe: Get information about an extended control (IExtenderProvider) Pin
giplet25-May-06 10:48
giplet25-May-06 10:48 
GeneralRe: Get information about an extended control (IExtenderProvider) [modified] Pin
giplet25-May-06 10:51
giplet25-May-06 10:51 
GeneralRe: Get information about an extended control (IExtenderProvider) [modified] Pin
Ed.Poore25-May-06 12:42
Ed.Poore25-May-06 12:42 
GeneralRe: Get information about an extended control (IExtenderProvider) [modified] Pin
Christian Wikander25-May-06 22:22
Christian Wikander25-May-06 22:22 
GeneralRe: Get information about an extended control (IExtenderProvider) Pin
Ed.Poore26-May-06 0:15
Ed.Poore26-May-06 0:15 
GeneralRe: Get information about an extended control (IExtenderProvider) Pin
Christian Wikander26-May-06 0:54
Christian Wikander26-May-06 0:54 
QuestionBiztalk Server Category Pin
FirozOzman25-May-06 9:06
FirozOzman25-May-06 9:06 
Questionhelp me Pin
lucky123456025-May-06 9:02
lucky123456025-May-06 9:02 
AnswerRe: help me Pin
Ed.Poore25-May-06 9:50
Ed.Poore25-May-06 9:50 
GeneralRe: help me [modified] Pin
User 171649225-May-06 13:20
professionalUser 171649225-May-06 13:20 
Questionvirtual application root in javascript? what's the "~" in js?? Pin
lsugirljte25-May-06 8:59
lsugirljte25-May-06 8:59 
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!

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.