Erroe en grabar
Publicado por Pinky (110 intervenciones) el 04/08/2010 00:48:39
Hola amigos del foro mi consulta es la siguinte que al momento de grabar me manda el siguiente mensaje de error: "String or binary data would be truncated. The statement has been terminated.", de todas menras les menciono el codigo que utilizo para grabar llevo varuos formularios con la misma técnica y primera vez que me psa esto.
Protected Sub CMDGRABAR_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CMDGRABAR.Click
If TXTNOMBRE.Text = "" Then
MsgBox("Ud. debe ingresar el Nombre del Asegurado", MsgBoxStyle.Critical, "FVJ")
Exit Sub
End If
Dim sql As New SqlClient.SqlCommand("insert into Analizacion_RSA(Nombre_Asegurado,Siniestro,Aseguradora,Vehiculo,Chasis_Vehiculo,Subtotal_Repuestos,Iva_Repuestos,Total_Repuestos,Subtotal_Repuestos1,Iva_Repuestos1,Total_Repuestos1,Subtotal_Repuestos2,Iva_Repuestos2,Total_Repuestos2,Subtotal_Repuestos3,Iva_Repuestos3,Total_Repuestos3,Activo)" & _
"values('" + TXTNOMBRE.Text + "'," + TXTSINIESTRO.Text + ",'" + TXTASEGURADORA.Text + "','" + TXTVEHICULO.Text + "','" + TXTCHASIS.Text + "'," + TXTSUBTOTAL.Text + "," + TXTIVA.Text + "," + TXTTOTAL.Text + "," + TXTSUBTOTAL1.Text + "," + TXTIVA1.Text + "," + TXTTOTAL1.Text + "," + TXTSUBTOTAL2.Text + "," + TXTIVA2.Text + "," + TXTTOTAL2.Text + "," + TXTSUBTOTAL3.Text + "," + TXTIVA3.Text + "," + TXTTOTAL3.Text + ",1);", conn)
If MsgBox("¿Desea grabar estos datos.?", MsgBoxStyle.YesNo, "FVJ") = vbYes Then
sql.ExecuteNonQuery()
Graba()
End If
Try
MsgBox("Datos grabados satisfactoriamente", MsgBoxStyle.Information, "FVJ")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Limpiar_datos()
End Sub
ojala que me puedan ayudar ya que estoy parado en esta situación, desde ya muchas gracias.
Protected Sub CMDGRABAR_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CMDGRABAR.Click
If TXTNOMBRE.Text = "" Then
MsgBox("Ud. debe ingresar el Nombre del Asegurado", MsgBoxStyle.Critical, "FVJ")
Exit Sub
End If
Dim sql As New SqlClient.SqlCommand("insert into Analizacion_RSA(Nombre_Asegurado,Siniestro,Aseguradora,Vehiculo,Chasis_Vehiculo,Subtotal_Repuestos,Iva_Repuestos,Total_Repuestos,Subtotal_Repuestos1,Iva_Repuestos1,Total_Repuestos1,Subtotal_Repuestos2,Iva_Repuestos2,Total_Repuestos2,Subtotal_Repuestos3,Iva_Repuestos3,Total_Repuestos3,Activo)" & _
"values('" + TXTNOMBRE.Text + "'," + TXTSINIESTRO.Text + ",'" + TXTASEGURADORA.Text + "','" + TXTVEHICULO.Text + "','" + TXTCHASIS.Text + "'," + TXTSUBTOTAL.Text + "," + TXTIVA.Text + "," + TXTTOTAL.Text + "," + TXTSUBTOTAL1.Text + "," + TXTIVA1.Text + "," + TXTTOTAL1.Text + "," + TXTSUBTOTAL2.Text + "," + TXTIVA2.Text + "," + TXTTOTAL2.Text + "," + TXTSUBTOTAL3.Text + "," + TXTIVA3.Text + "," + TXTTOTAL3.Text + ",1);", conn)
If MsgBox("¿Desea grabar estos datos.?", MsgBoxStyle.YesNo, "FVJ") = vbYes Then
sql.ExecuteNonQuery()
Graba()
End If
Try
MsgBox("Datos grabados satisfactoriamente", MsgBoxStyle.Information, "FVJ")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Limpiar_datos()
End Sub
ojala que me puedan ayudar ya que estoy parado en esta situación, desde ya muchas gracias.
Valora esta pregunta


0