我在sql server中有数据的datagridview,我想用dataadapter删除所选的行这是我的代码
DialogResult dr;
dr = MessageBox.Show("Are you sure you want to delete this User?", "Delete User", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
da.DeleteCommand = new SqlCommand("DELETE FROM tb_Accounts WHERE AccountID=@AccountID", conn);
da.DeleteCommand.Parameters.Add("@AccountID",SqlDbType.Int).Value = ds.Tables[0].Rows;
conn.Open();
da.DeleteCommand.ExecuteNonQuery();
conn.Close();
}
我的错误是找不到表0,我不知道那是什么..