How can I save a DateTime from my C# program into a SQL Server (datetime) database column.

  • Thread starter Thread starter Steve Kershaw
  • Start date Start date
S

Steve Kershaw

Hi I have a problem in that I need to save the creation date of a new
record to a column. The column is set up as a datetime type and the C#
date is a DateTime type. I keep on getting an error that states that
I'm trying to write to a SQL column that's set up as an 'int'.

Is there anyway to do this?

Thanks very much for your help.
Steve
 
There must be something else going on, but since you did not post code or a
reproduceable case, it's hard to say. YOu also didn't post the exact error
message.
 
I did post an exact error with code yesterday and I got NO RESPONSE. So
I thought I'd simplify the statement of the problem, maybe that would
help.

If you don't know how to fix the problem then jumping on the newbees
will only insure that they go somewhere else to get their answers.

Steve
 
I did post an exact error with code yesterday and I got NO RESPONSE. So
I thought I'd simplify the statement of the problem, maybe that would
help.

If you don't know how to fix the problem then jumping on the newbees
will only insure that they go somewhere else to get their answers.

Steve
 
Mark,

Ok so how do I set the current date & time on a column in SQL Server
2005? I have tried right click-Default Value or Binding, but to no
avail!

Thanks for your help.

Steve
 
Back
Top