I'm getting this error when I hit this line objCommand.ExecuteNonQuery()
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
Code:Dim sqlCmd As String = "insert into DBATEST.PCMS_Billing_Period (begin_billing_date,end_billing_date,credit_card_no,employee_work_unit,status_ind) " sqlCmd = sqlCmd & "values (?,?,?,?,?)" Dim objCommand As New OleDbCommand(sqlCmd, objConnection) objCommand.Parameters.Add("@begin_billing_date", System.Data.OleDb.OleDbType.Date).Value = dp1.Value objCommand.Parameters.Add("@end_billing_date", System.Data.OleDb.OleDbType.Date).Value = dp2.Value objCommand.Parameters.Add("@credit_card_no", System.Data.OleDb.OleDbType.Char, 16).Value = txtCreditNo.Text objCommand.Parameters.Add("@employee_work_unit", System.Data.OleDb.OleDbType.Char, 4).Value = txtWorkUnit.Text objCommand.Parameters.Add("@status_ind", System.Data.OleDb.OleDbType.Char, 1).Value = Post_to_Int objConnection.Open() objCommand.ExecuteNonQuery() objConnection.Close()




Reply With Quote