我的gridview中的數據是從兩張表T1,T2裡面調出來的,但是我只要刪除T1裡面的內容。
SqlDataSouce代碼如下:
ConnectionString=""
DeleteCommand="DELETE FROM paper WHERE paper_id = @original_paper_id AND question_num = @original_question_num"
SelectCommand="SELECT paper_id as 試卷編號, question_num as 題號, t1.value as 分值,title as 題干,type as 題型,diffic as 難度,chapter as 章節 FROM paper as t1 INNER JOIN question as t2 ON t1.num=t2.num">
/asp:SqlDataSource
大神可以看我的 DeleteCommand和,沒有刪問題,但是怎麼也刪除不了。
數據庫中T1表是這樣的:
PS:把DeleteCommand中的刪除語句在數據庫中可以執行。
original_paper_id
original_question_num
有沒有傳對,sql有沒有執行
總之這種問題自己要學會調試。