
提示没有名字。。但是我设计界面的时候已经把相应的name改为txtname和txtPwd了。为什么还不行 啊????
protectedvoidButton1_Click(objectsender,EventArgse){stringuserName=this.txtName.Text....
protected void Button1_Click(object sender, EventArgs e)
{
string userName = this.txtName.Text.trim();
string password = this.txtPwd.Texttrim();
string connString = @"Data Source=3d8e899934c443e\SQLEXPRESS;Initial Catalog=wangjuan;Integrated Secruity=true";
SqlConnection connection = new SqlConnection(connString);
string sql = String.Format("select count(*) from (tb_user) where userName = '{0}' and Password='{1}'",userName,password);
//try
//{
connection.Open();
SqlCommand command = new SqlCommand(sql, connection);
int num = (int)command.ExecuteScalar();
if (num > 0)
{
Response.Redirect("~/Default2.aspx");
}
// }
// catch (Exception ex)
// {
// mbox(ex.Message,"ERROR!!",mbox.OK,);
// }
提示没有txtName和txtPwd,但是都肯定有改了名字的。。 展开
{
string userName = this.txtName.Text.trim();
string password = this.txtPwd.Texttrim();
string connString = @"Data Source=3d8e899934c443e\SQLEXPRESS;Initial Catalog=wangjuan;Integrated Secruity=true";
SqlConnection connection = new SqlConnection(connString);
string sql = String.Format("select count(*) from (tb_user) where userName = '{0}' and Password='{1}'",userName,password);
//try
//{
connection.Open();
SqlCommand command = new SqlCommand(sql, connection);
int num = (int)command.ExecuteScalar();
if (num > 0)
{
Response.Redirect("~/Default2.aspx");
}
// }
// catch (Exception ex)
// {
// mbox(ex.Message,"ERROR!!",mbox.OK,);
// }
提示没有txtName和txtPwd,但是都肯定有改了名字的。。 展开
1个回答
展开全部
现在网易就是s b,各种问题各种纠结~ GM你干脆就别问了 100%解决不了 直接打客服
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询