//創建數據庫連接
STconn = new SqlConnection(STconnection);
}
else
{
Response
}
}
private void STDe_add_Click(object sender
{
//創建插入產品信息的sql語句
string STstrsql =
//根據sql語句
SqlCommand STcmd = new SqlCommand(STstrsql
STcmd
STcmd
STcmd
try
{
//執行sql語句
STcmd
//Label提示添加成功
STProd_warn
//提示信息的字體顏色
STProd_warn
Response
}
catch(SqlException)
{
//Label提示添加失敗
STProd_warn
STProd_warn
Response
}
}
right
From:http://tw.wingwit.com/Article/program/net/201311/15656.html