I'm getting this error message (see image). I've defined most of my fields in the SQL table as decimal(5,2). I'm guessing this message is a result of trying to put a value larger than what the field is defined for.
Here's my code in my VB.Net app as well as a screenshot of my SQL DB Table.
Thanks,Code:Public Function Insertcustomer() As Boolean Try Insertcustomer = False strSQL = "INSERT INTO tblCustomers " & _ "(customerID," & _ "custName," & _ "useBackOrders," & _ "usePurchaseOrders," & _ "applyDiscounts," & _ "email," & _ "shipMethod," & _ "website," & _ "addrDesc," & _ "paymentTerms," & _ "businessID," & _ "systemStatus) " & _ "VALUES " & _ "('" & customer.customerID & "'," & _ "'" & customer.custName & "'," & _ "'" & customer.UseBackOrders & "'," & _ "'" & customer.UsePurchaseOrders & "'," & _ "'" & customer.ApplyDiscounts & "'," & _ "'" & customer.Email & "'," & _ "'" & customer.ShipMethod & "'," & _ "'" & customer.Website & "'," & _ "'" & customer.AddrDesc & "'," & _ customer.PaymentTerms & "," & _ "'" & customer.BusinessID & "'," & _ "'" & customer.SystemStatus & "')" Dim ins As New SqlCommand(strSQL, cnn) customer.adpcustomers.InsertCommand = ins customer.adpcustomers.InsertCommand.ExecuteNonQuery() Insertcustomer = True Catch ex As Exception MessageBox.Show(ex.Message, "System Message", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Function




Reply With Quote