Delete record database from DataGridview cell
<p>I have a delete button syntax problem in c sharp
and I've made a syntax like this delete button</p>

<pre><code>string conection = "Provider = Microsoft.Jet.OleDb.4.0;Data Source=Database.mdb";
try
{
    int i = 0;
    for (i = 0; i &lt; dataGridView1.CurrentRow.Cells.Count; i++)
    {
        DataGridViewCell cell = dataGridView1.CurrentRow.Cells[i];
        if (cell.Selected == true)
        {
            string sql = string.Format("DELETE * FROM mahasiswa WHERE " + i + " ");

            OleDbConnection conn = new OleDbConnection(conection);
            conn.Open();
            dataGridView1.Rows.RemoveAt(i);

            OleDbCommand cmd = new OleDbCommand(sql, conn);
            cmd.ExecuteNonQuery();

            conn.Close();
        }
    }
}
catch (OleDbException ex)
{
    MessageBox.Show(ex.ToString());
}
</code></pre>

<p>but the code is syntax error in query, database records do not go to delete</p>

<p>how to code the query syntax is correct?
please help me</p>

<p>I created a database from microsoft access to the names and table names database.mdb supplier with columns id, name, address
primary key: id</p>
