}
}
else
{
Response
}
}
//單擊修改按鈕所觸發的事件
private void STUpdate_ok_Click(object sender
{
//判斷原密碼是否為空
if(STOld_pwd
{
//判斷新密碼和確認密碼是否為空
if(STNew_pwd
{
//獲得數據庫連接字符串
string STconnection = ConfigurationSettings
SqlConnection STconn = new SqlConnection(STconnection);
STconn
//根據文本框裡的內容創建修改密碼的sql語句
string STstrsql=
SqlCommand STcmd = new SqlCommand(STstrsql
try
{
//執行sql語句
STcmd
//提示修改成功
STUserPwd
Response
}
catch(SqlException)
{
STUserPwd
STUserPwd
}
STconn
}
else
{
STUserPwd
}
}
else
{
STUserPwd
}
}
right
From:http://tw.wingwit.com/Article/program/net/201311/15331.html