|
-
Sep 24th, 2008, 06:47 AM
#1
Thread Starter
New Member
Sending Datetime from VB 2005 Form to Sql Sever
Sql Server has column date time. I am required to send date in the format
"Mm/dd/yyyy hh:mm:ss tt" from my windows form.
I get date from datetimepicker control in form & I tried converting by doing this before i sent it to database through arraylist
Dim dt As DateTime = Convert.ToDateTime(DOB.Text)
canArraylst.Add(dt.ToString("MM/dd/yyyy hh:mm:ss tt"))
& current date as
nowDt = "MM/dd/yyyy hh:mm:ss tt"
canArraylst.Add(System.DateTime.Now.ToString(nowDt))
the error I get is cannot convert string to date time.
When i send the date in this format
canArraylst.Add("1/1/2008")
The SQl Procedure works fine.
Any suggestion to resolve this issue?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|