Problema con fecha enVB.net a sql

Tengo el sig código
Dim cmd As New SqlCommand("Update historico set Nombre='" & TextBox1.Text & "', Apaterno='" & TextBox2.Text & "',Amaterno='" & TextBox3.Text & "',Edad=" & Int32.Parse(TextBox4.Text) & " ,Talla=" & Int32.Parse(TextBox5.Text) & ",Peso=" & Int32.Parse(TextBox6.Text) & ",Fr=" & Int32.Parse(TextBox7.Text) & ",Fc=" & Int32.Parse(TextBox8.Text) & ",Temp= " & Int32.Parse(TextBox9.Text) & ",Alergia=' " & TextBox10.Text & "',Diagnostico=' " & TextBox11.Text & " ',Prescripcion=' " & RichTextBox1.Text & "',Fecha='" & DateTimePicker1.value & "',Proxcita='" & DateTimePicker2.value & "' where Nombre='" & TextBox1.Text & "' and Apaterno='" & TextBox2.Text & "' and Amaterno ='" & TextBox3.Text & "'", cnmodificar)
Y m marca error al agregar la fecha
El error es
Conversion failed when converting date and/or time from character string.
En la Bd de SQL lo tengo como date
Y lo estoy agregando desde un datetimepicker
Desde ya gracias!
Respuesta
1
Trata de usar datetime y verifica si los formatos coinciden: yy\mm\dd

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas