Nw BBS 壬天堂世界

 找回密码
 注册
搜索
热搜: 资料集合
查看: 1197|回复: 4
收起左侧

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

[复制链接]
发表于 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[0];                                                               
                                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 编辑 ]
回复

使用道具 举报

发表于 2006-5-7 20:58:30 | 显示全部楼层
靠……

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

使用道具 举报

 楼主| 发表于 2006-5-7 20:59:49 | 显示全部楼层
本来以为user关键字

但是我改了还不行
回复

使用道具 举报

发表于 2006-5-7 20:59:51 | 显示全部楼层
....真把水区当神区了...
回复

使用道具 举报

发表于 2006-5-7 21:03:11 | 显示全部楼层
又见XX语言
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|Nw壬天堂世界 ( 京ICP备05022083号-1 京公网安备11010202001397号 )

GMT+8, 2024-10-13 01:17 , Processed in 0.019107 second(s), 4 queries , Redis On.

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表