0
SqlConnection con = new SqlConnection( "Data Source=AMBADNYA-PC;Initial
         Catalog=MYRAWPRO;Persist Security Info=True;User ID=sa;Password=sa");

string query = "DELETE FROM Sales  WHERE Sales_ID =" + 
                dataGridViewProduct.SelectedRows[0].Cells[0].Value.ToString();

SqlCommand com = new SqlCommand();

com.CommandText = query;
com.Connection = con;
con.Open();
com.ExecuteNonQuery();
con.Close();

MessageBox.Show("Deleted");

但它显示错误

Invalid column name 'uiui'.

uiui是列值。我究竟做错了什么?

4

0 回答 0