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

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
 
M

Marina Levit [MVP]

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.
 
S

Steve Kershaw

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
 
S

Steve Kershaw

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
 
S

Steve Kershaw

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top