小毛头 发表于 2006-5-7 20:45:57

水区万能帖啊!!!!这个东西...

private void Button1_Click(object sender, System.EventArgs e)
                {   
                        string stringconn="server=127.0.0.1;uid=sa;pwd=123123;database=game";
                        SqlConnection conn=new SqlConnection(stringconn);
                        string strSQL="select * from useradmin where id = '"+textBox1.Text+"'";
                        SqlDataAdapter sqlDataAdapter= new SqlDataAdapter(strSQL,conn);
                        DataSet ds = new DataSet();
                        sqlDataAdapter.Fill(ds,"useradmin");
                        if (ds.Tables["useradmin"].Rows.Count>0)                                                       
                        {                                                               
                                DataRow myDR=ds.Tables["useradmin"].Rows;                                                               
                                if (textBox2.Text==myDR["password"].ToString().Trim())
                                {
                                                Response.Write("<script>window.open('user.aspx','contents');</script>");
                                                                           }       
                                else Response.Write("<script>window.open('error.htm','main');</script>");
                        }else Response.Write("<script>window.open('error.htm','main');</script>");
                }


为什么链不上数据库
登陆的时候说sa无法登陆

iis和sql都采用集成登陆模式

如果把pwd后面的密码写了,也无法登陆

[ 本帖最后由 小毛头 于 2006-5-7 21:43 编辑 ]

kunoichifans 发表于 2006-5-7 20:58:30

靠……

发去PC区
水区多万能都没几个能帮你- =

小毛头 发表于 2006-5-7 20:59:49

本来以为user关键字

但是我改了还不行

IVAN1707 发表于 2006-5-7 20:59:51

....真把水区当神区了...

chaos00000 发表于 2006-5-7 21:03:11

又见XX语言
页: [1]
查看完整版本: 水区万能帖啊!!!!这个东西...