private void Button1_Click(object sender, System.EventArgs e)
{
string stringconn="server=127.0.0.1;uid=sa;pwd=;database=teacher";
SqlConnection conn=new SqlConnection(stringconn);
string strSQL="select password from user where id = '"+textBox1.Text+"'";
SqlDataAdapter sqlDataAdapter= new SqlDataAdapter(strSQL,conn);
DataSet ds = new DataSet();
sqlDataAdapter.Fill(ds,"user");
if (ds.Tables["user"].Rows.Count>0)
{
DataRow myDR=ds.Tables["user"].Rows[0];
if (textBox2.Text==myDR["password"].ToString().Trim())
{
Response.Write("<script>window.open('error.htm','main');</script>");}
else Response.Write("<script>window.open('user.aspx','contents');</script>"); }
}为什么链不上数据库
登陆的时候说sa无法登陆iis和sql都采用集成登陆模式如果把pwd后面的密码写了,也无法登陆
{
string stringconn="server=127.0.0.1;uid=sa;pwd=;database=teacher";
SqlConnection conn=new SqlConnection(stringconn);
string strSQL="select password from user where id = '"+textBox1.Text+"'";
SqlDataAdapter sqlDataAdapter= new SqlDataAdapter(strSQL,conn);
DataSet ds = new DataSet();
sqlDataAdapter.Fill(ds,"user");
if (ds.Tables["user"].Rows.Count>0)
{
DataRow myDR=ds.Tables["user"].Rows[0];
if (textBox2.Text==myDR["password"].ToString().Trim())
{
Response.Write("<script>window.open('error.htm','main');</script>");}
else Response.Write("<script>window.open('user.aspx','contents');</script>"); }
}为什么链不上数据库
登陆的时候说sa无法登陆iis和sql都采用集成登陆模式如果把pwd后面的密码写了,也无法登陆
解决方案 »
- 怎么将webRequst得到的CookieContainer 给webBrowser 共享cookie
- 菜鸟:我做了一个c#窗体程序,用的是access,但是移到其他电脑上就不能用了,请高手们指点一下
- 读取图片成二进制文件,然后保存数据变了
- c# 中关于 枚举类型作为参数传递
- 1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26
- 一个轮询数据库的后台程序,运行一会会死掉
- 布署的问题~~~~~,在GOOGLE上找了几十页都没找到解决办法,,,,高人进来~~~~~~~
- 有没有内蒙古地区C#高手和驱动开发或系统核心高手,请帖联系方式
- 为什么关不了Excel进程
- “无法创建Visual C#编译器,无法打开工程...您需要重新安装VS.NET”大家遇到过这种情况吗?
- 在使用httpwebrequest时,向servlet提交http的post时,中文都变成了乱码.....
- Excel 重载“Insert”方法未获取“1”参数 什么原因??
采用windows混合验证方式