Add data to database
Hi
I got an error for the following code.
The error is "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
The error is with the ExecuteNonQuery line.
if(textBox1.Text != "" && textBox3.Text != "")
{
dataSet1.Clear();
oleDbDataAdapter1.InsertCommand.CommandText = "INSERT INTO Final (Invoice Number, Name, Amount) VALUES ('"+textBox1.Text+"', '"+textBox2.Text+"', '"+Int32.Parse(textBox3.Text) +"')";
oleDbDataAdapter1.InsertCommand.ExecuteNonQuery();
oleDbDataAdapter1.Fill(dataSet1);
}
What I want to do is to add values into the database, and I can't get it to work..Can anyone please help