I am getting this error when I am trying to insert a new record to an sql table.
Any ideas on how to resolve this issue?
My code for inserting the record is:
Code:
Arithmetic overflow error converting expression to data type datetime.
Any ideas on how to resolve this issue?
My code for inserting the record is:
Code:
Dim conOrders As SqlConnection
Dim strInsert As String
Dim cmdInsert As SqlCommand
conOrders = New SqlConnection("Server=(local);UID=sa;PWD=admin2010;database=PhoenixSQL")
strInsert = "Insert dbo.Orders (TraderID, OrderNumber, InvoiceNumber, InvoiceDate, Carriage) Values (@TraderID, @OrderNumber, @InvoiceNumber, @InvoiceDate, @Carriage)"
cmdInsert = New SqlCommand(strInsert, conOrders)
cmdInsert.Parameters.AddWithValue("@TraderID", HiddenTraderID.Value)
cmdInsert.Parameters.AddWithValue("@OrderNumber", txtOrderNumber.Text)
cmdInsert.Parameters.AddWithValue("@InvoiceNumber", txtInvoiceNumber.Text)
cmdInsert.Parameters.AddWithValue("@InvoiceDate", txtInvoiceDate.Text)
cmdInsert.Parameters.AddWithValue("@Carriage", txtCarriage.Text)
conOrders.Open()
cmdInsert.ExecuteNonQuery()
conOrders.Close()