有两个表:
Table1 : UserID Name Job
Table2 : BookID Book Car UserID
我将这两个表加载到一个 wpf 数据网格中:
da.SelectCommand = new SqlCommand("select Table1.UserID, Table1.Name, Table1.Job, Table2.Book, Table2.Car from Table1 inner join Table2 on Table1.UserID = Table2.UserID");
我想通过 DataGrid 从 Table2 中删除一行:
SqlCommand com = new SqlCommand("delete from Table2 where BookID=@BookID)",con);
但不工作,
我该怎么做?