Hi I am trying to submit a date value from a DateTimePicker1 using short date format 05/02/2011 I get an error on submission
.NetSqlClient Data Provider:conversion failed when converting date and/or time from charecter to string
this is my insert
cmd1 = conn.CreateCommand
cmd1.CommandText = "INSERT INTO tenant(firstName, lastName, Email, phone, dob, rentPaid, rent, dateIn, deposit, service, rentDueDate, property,notes, previous) VALUES('" & Trim(TextBoxFirstName.Text) & "','" & Trim(TextBoxLastName.Text) & "','" & Trim(MaskedEditBoxEmail.Text) & "','" & Trim(TextBoxPhone.Text) & "','" & Trim(MaskedEditBoxDob.Text) & "','" & Trim(MaskedEditBoxRentPaid.Text) & "','" & Trim(TextBoxRent.Text) & "','" & (DateTimePicker1.Text) & "','" & Trim(MaskedEditBoxDeposit.Text) & "','" & Trim(MaskedEditBoxService.Text) & "','" & (TextBoxRentDue.Text) & "','" & Trim(RadDropDownList1.Text) & "','" & Trim(TextBoxNotes.Text) & "','" & "True" & "')"
check = cmd1.ExecuteReader.RecordsAffected()
my db table
[t_id] [int] IDENTITY(1,1) NOT NULL,
[firstName] [varchar](20) NOT NULL,
[lastName] [varchar](20) NOT NULL,
[email] [varchar](250) NULL,
[phone] [numeric](18, 0) NULL,
[dob] [date] NOT NULL,
[rentPaid] [numeric](18, 0) NULL,
[rent] [numeric](18, 0) NULL,
[dateIn] [date] NOT NULL,
[deposit] [numeric](18, 0) NULL,
[service] [numeric](18, 0) NULL,
[rentDueDate] numeric (18,0) NULL,
[property] [varchar](10) NULL,
[notes] [text] NULL,
[existing] [bit] NULL,
[previous] [bit] NULL,
CONSTRAINT [PK_tennant] PRIMARY KEY CLUSTERED
cannot figure out why its not seeing it as a date?