坚持真的就是胜利。现在有个小问题,求组!!!
2012-11-07 22:56
441 查看
为什么我下面的代码运行出来得不到按登录的时候不能跳转????
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class User_user_login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string name = TextBox1.Text;
string pwd = TextBox2.Text;
string SqlStr = "Server = jf7ph5fx9i5xamq; uid= sa; pwd = 1;DataBase= jdzlyw";
SqlConnection con = new SqlConnection(SqlStr);
SqlCommand cmd = con.CreateCommand();
con.Open();
cmd.CommandText = "select username,userpwd from user where username='" + name + "' and userpwd='" + pwd + "'";
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Session["user"] = name;
Response.Redirect("user-insert.aspx");
}
else {
message.Text = "用户名或密码错误";
}
con.Close();
}
}
现在是2012年11月7日22:59:50,,,我是小six。。我在坚持。。坚持就是胜利,昨天的一个难题因为今天我的坚持,解决了。。。
我的毕业设计在我面前思路相当的清晰,就是代码的问题,我相信随着我不断的看书,不断的思考。。。。。会完成的!!!
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class User_user_login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string name = TextBox1.Text;
string pwd = TextBox2.Text;
string SqlStr = "Server = jf7ph5fx9i5xamq; uid= sa; pwd = 1;DataBase= jdzlyw";
SqlConnection con = new SqlConnection(SqlStr);
SqlCommand cmd = con.CreateCommand();
con.Open();
cmd.CommandText = "select username,userpwd from user where username='" + name + "' and userpwd='" + pwd + "'";
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Session["user"] = name;
Response.Redirect("user-insert.aspx");
}
else {
message.Text = "用户名或密码错误";
}
con.Close();
}
}
现在是2012年11月7日22:59:50,,,我是小six。。我在坚持。。坚持就是胜利,昨天的一个难题因为今天我的坚持,解决了。。。
我的毕业设计在我面前思路相当的清晰,就是代码的问题,我相信随着我不断的看书,不断的思考。。。。。会完成的!!!
相关文章推荐
- 压力越大,越耐压,坚持就是胜利!
- 坚持就是胜利
- 博客,我来了,坚持就是胜利
- 今天开学Oralce 现在坚持每天写技术文档,也就是笔记了!!
- 第五次面试,坚持就是胜利!
- 开播第一天,庆祝下,坚持就是胜利
- BizTalk是什么,能作什么?这个问题,以前我也搜过,不过还是一头雾水.现在知道了,它就是一个翻译官
- 今天我感觉自己不能做一点。就是:再坚持一会,再坚持一会我就不是现在这样子了。
- 坚持就是男人的胜利,我要在CSDN坚持我的博客
- 脚踏实地的做事,诚诚恳恳做人---坚持就是胜利
- 坚持就是胜利!悔不当初
- 坚持,真的就是胜利!
- [南阳OJ-No.24]素数距离问题|现在给出你一些数,要求你写出一个程序,输出这些整数相邻最近的素数,并输出其相距长度。如果左右有等距离长度素数,则输出左侧的值及相应距离。 如果输入的整数本身就是素
- 为什么现在很多年轻人愿意来北上广深打拼,即使过得异常艰苦,远离亲人,仍然义无反顾? 谈谈程序员返回家乡的创业问题 利基市场就是那些不大不小的缝隙中的市场 马斯洛的需求无层次不适合中国。国人的需求分三个层次——生存、稳定、装逼。对应的,国内的产品也分三个层次——便宜、好用、装B。人们愿意为这些掏钱
- 今天开始写外挂了 呵呵 坚持就是胜利
- 熟悉的时间,坚持就是胜利!
- 坚持就是胜利!
- 坚持就是胜利
- 坚持就是胜利
- 坚持就是胜利- -。。。。