DateTimePicker Datepart problem **Super Urgent**

G

Guest

Can anybody really help with the following please please....

I have a DateTimePicker called customer_picker
I use it and then want to insert it to a table OrderHdr.DUEDATE which is data type DateTime on my SQLCE DB
The code i use to insert is as follows and i receive a datepart error on the insert: I insert the customer_picker as string, maybe that is why but i dont quite understand why the datepart error. Any help muchly appreciated

MessageBox.Show("insert")
MessageBox.Show(customer_picker.Text)

Dim strSQL As String = "INSERT into OrderHdr ( " & _
" REFRENCE, CUSTNMBR, DOCDATE, DUEDATE, " & _
" SLPRSNID, TOTALQTY, " & _
" PONUMBER, DELREP, DIVISION, COMMENT, CONTACT ) VALUES ( '" + txtHdrRefrence.Text + "', '" + txtCustNmbr.Text + "', " & _
" getdate(), '" + customer_picker.Text + "', '" + SLPRSNID.Text + "', " & _
" 0.00, '" + txtPO.Text + "', '" + DelRep + "', '" + cmbOHDiv.Text + "', '" + txtComment.Text + "', '" + tbContact.Text + "')"
 
J

Jon Skeet [C# MVP]

marcmc said:
Can anybody really help with the following please please....

Yes. I did so last night. Please read the response to your previous
question.
 

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

Similar Threads


Top