I have the following method to inserting data into a an access databasewhich works fine but I do get a problem if I try to insert text that contains single quotes I have lea
OleDbCommand cmd = new OleDbCommand("insert into table_name (ID,Type,SrNo) Values ('" + textboxId.Text + "','" + textboxType.Text + "' ,'" + textboxSr.Text + "');", oc); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); MessageBox.Show("Data has been saved successfully"); cmd.Dispose();