Date format problem

  • Thread starter Thread starter Herryandi
  • Start date Start date
H

Herryandi

Hi all,

Im having date format in my ms sql server 2000
database. I always get a problem in inserting or updating
data because of my date format. Im taking the value of
date from textbox. This is how the code:

dim d as date
d = txtDate1.Text

and the sql string is like this

sqlStr1 = "INSERT INTO CONTACT Values( " & _
d.ToShortDateString & ",'" & txtName.Text
& "')"

The error is with the date format.
Anyone have any idea about this problem

Thanks

But
 
What is the name of your Date Field in your database. I know that date
is a reserved word in Access.

Have you tried:

dim d as string
 
HerrYAndi
Guess it would be better if u write a stored procedure for ur SQl
insert!
Patrick
 
Back
Top