Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you assign a fieldname current system date?

Status
Not open for further replies.

Ken011

MIS
Oct 13, 2006
66
0
0
US
Greetings experts.
In classic asp, you would assign a field name system date like this:

sql="insert into tableName (dateField) Values (#" & date()&"#)

I am using MS Access database.

How do you do the same us asp.net (vb)?

The following isn't working for me:

Code:
        cmdcommand = New OleDbCommand( _
         "INSERT INTO Results (fDate) " & _
         "VALUES (@fDate)",conn)        
 
cmdcommand.Parameters("@fdate").Value = DateTime.Now.ToString("dd-MMM-yyyy")

Thanks in advance
 
it will look something like this, but double check the overload I used:
cmdcommand.Parameters("fdate", SqlDataType.DateTime).Value = DateTime.Now.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top