try
{
SqlConnection con = new SqlConnection("Data Source=10.63.88.12;Initial Catalog=wlsb;User ID=wlsb;Password=wlsb123");
con.Open();
SqlCommand com = new SqlCommand("select * from TbYhxx where Yhid='"+TextBox1.Text+"'and Yhmm='"+TextBox2.Text+"'",con);
if(com.ExecuteScalar()!=null)
{
Session["kk"]=this.TextBox1.Text.ToString();
con.Close();
Response.Redirect("MainPage.aspx");
}
else
{
Response.Redirect("Default.aspx");
}
}
catch (Exception ee)
{
Response.Write(ee.Message.ToString());
}
}
{
SqlConnection con = new SqlConnection("Data Source=10.63.88.12;Initial Catalog=wlsb;User ID=wlsb;Password=wlsb123");
con.Open();
SqlCommand com = new SqlCommand("select * from TbYhxx where Yhid='"+TextBox1.Text+"'and Yhmm='"+TextBox2.Text+"'",con);
if(com.ExecuteScalar()!=null)
{
Session["kk"]=this.TextBox1.Text.ToString();
con.Close();
Response.Redirect("MainPage.aspx");
}
else
{
Response.Redirect("Default.aspx");
}
}
catch (Exception ee)
{
Response.Write(ee.Message.ToString());
}
}
解决方案 »
- GridView删除无效,请帮忙解决。
- asp.net给出错误的ORACLE exception
- 大虾门 看看这个 为啥每次刷新都执行
- Entity Framework中查询怎么把固定的条件变成变量的形式
- Discuz代码问题..在线等
- 层和布局的问题
- 新手问个小CASE```各位有经验的大哥帮帮忙..
- 请教各位大侠----我想在.net下,用owc做报表,该如何使用??急....在线等待
- 为什么我在2003中使用ie中自己带的打印控件总是提示我没有权限?
- 请问一下在asp与asp.net 中共享cookie的时候中文出现乱码怎么解决?
- 新手上路,遇害隐藏gridview列出现的问题
- 新闻系统中 什么是 投稿管理? 用来干什么的?此功能的需求是什么?
显示用户名不存在可用脚本方式或放一个LABEL来显示。
Response.Write("<script language='javascript'>alert('用户名不能为空');self.location.href='login.aspx';</script>");
05:
ClientScript.RegisterStartupScript(getTypr(),"","<script>alert('不能为空!')</script>");