(
//單擊
public void STmyGrid_edit(object source
{
//獲取DataGrid所要編輯的項的索引
STmyGrid
BindGrid();
}
(
//單擊
public void STmyGrid_update(object source
{
//根據文本框信息創建更新用戶信息的sql語句
string STstrsql=
//創建SqlCommand對象
SqlCommand STcmd=new SqlCommand(STstrsql
try
{
//向SqlCommand對象添加參數
STcmd
STcmd
string stupdatetext=((TextBox)e
//向參數賦值
STcmd
STcmd
STcmd
//執行sql語句
STcmd
STmyGrid
}
catch(SqlException ex)
{
throw ex;
}
STcmd
BindGrid();
}
(
//單擊
public void STmyGrid_cancel(object source
{
//獲取DataGrid所要編輯的項的索引為
right
From:http://tw.wingwit.com/Article/program/net/201311/15655.html