没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
conn.Open();
string str1 = "select count (*) from tb_admin where hykh='" + TextBox1.Text.Trim() + "'";
SqlCommand sqlcmd = new SqlCommand(str1, conn);
int i = Convert.ToInt32(sqlcmd.ExecuteScalar());
if (i > 0)
{
Response.Write("<script>javascript:alert('该用户已经存在!!!');</script>");
}
else
{
string str = "insert into tb_admin (hykh,pwd,qx) values('" + TextBox1.Text.Trim() + "','" + TextBox2.Text.Trim() + "','" + DropDownList1.Text.Trim() + "')";
SqlCommand cmd = new SqlCommand(str, conn);
cmd.Dispose();
try
{
Session["hykh"] = TextBox1.Text;
cmd.ExecuteNonQuery();
Response.Write("<script>javascript:alert('添加成功!!!');</script>");
}
catch (SqlException)
{
Response.Write("<script>javascript:alert('添加失败!!!');</script>");
}
finally
{
conn.Close();
str = "";
}
string str1 = "select count (*) from tb_admin where hykh='" + TextBox1.Text.Trim() + "'";
SqlCommand sqlcmd = new SqlCommand(str1, conn);
int i = Convert.ToInt32(sqlcmd.ExecuteScalar());
if (i > 0)
{
Response.Write("<script>javascript:alert('该用户已经存在!!!');</script>");
}
else
{
string str = "insert into tb_admin (hykh,pwd,qx) values('" + TextBox1.Text.Trim() + "','" + TextBox2.Text.Trim() + "','" + DropDownList1.Text.Trim() + "')";
SqlCommand cmd = new SqlCommand(str, conn);
cmd.Dispose();
try
{
Session["hykh"] = TextBox1.Text;
cmd.ExecuteNonQuery();
Response.Write("<script>javascript:alert('添加成功!!!');</script>");
}
catch (SqlException)
{
Response.Write("<script>javascript:alert('添加失败!!!');</script>");
}
finally
{
conn.Close();
str = "";
}
资源评论
- xghslm2015-08-27可以使用。
a283465001
- 粉丝: 8
- 资源: 31
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功