//單擊刪除所觸發的事件
if(e
{
//自定義delete()
delete();
}
BindGrid();
}
//加載delete()
public void delete()
{
//獲取需要刪除的信息的id號
string ID = Session[
//創建刪除指定id的產品信息的sql語句
string STstrsql =
//創建數據庫的SqlCommand對象
SqlCommand STcmd = new SqlCommand(STstrsql
//向SqlCommand對象添加參數
STcmd
//給參數賦值
STcmd
STcmd
try
{
//執行sql語句
STcmd
}
catch(SqlException)
{
}
STmysql =
STcmd
Response
}
[
From:http://tw.wingwit.com/Article/program/net/201311/15283.html