I was wondering if you could help me out, I'm trying to do a DB Add, Update, Delete program and I was using your program khanhtrung for assistance and got the ADD working perfectly but UPDATE/DELETE will not work whatsoever, this is my code for my delete button, and for the delete part it's pretty much the same syntax and it keeps catching at the executenotquery line. If somebody could help me out I'd really appreciate it. Thank you.

private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MAconn != null && MAconn.State == ConnectionState.Open)
            {
                MAconn.Close();
                MAcmd.Dispose();
            }

            try
            {
                MAconn = new OleDbConnection();
                MAconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\John\\Desktop\\C# Final Project\\TicketReservationSystem\\Database1.mdb";
                MAconn.Open();
                MAcmd = MAconn.CreateCommand();
            }
            catch
            {
                MessageBox.Show("Database unable to be opened.");
                return;
            }

            MAcmd.CommandText = "DELETE FROM EventTable " +
                                "WHERE EventName = " + cmbEventList.Text;
            try
            {
                int row_affected = MAcmd.ExecuteNonQuery();
                MessageBox.Show("Artist was successfully removed from event list", "Success",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch
            {
                MessageBox.Show("Error removing artits", "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
MAcmd.CommandText = "DELETE FROM EventTable " +
                                "WHERE EventName = '" + cmbEventList.Text + "'";

Please do not resurrect old threads. If you want to ask question, start your own thread.

Have a look at forum rules.
Please read before posting - http://www.daniweb.com/forums/thread78223.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.