高手指教
我刚把SQL2000升级成了2005,
为什么同样的字符串在2005中就不能用啊。老是提示我:
无法打开登录所请求的数据库 "test"。登录失败。
用户 'sa' 登录失败。怎么回事啊?

解决方案 »

  1.   

    这是相关代码
    SqlConnection conn = new SqlConnection("server=.;database=test;uid=sa;pwd=820704");
            conn.Open();
            SqlCommand cmd = new SqlCommand("select name from voteType");
            SqlDataReader sdr = cmd.ExecuteReader();
            sdr.Read();        Response.Write(sdr[0].ToString());
            conn.Close();
      

  2.   

    连接字符串先修改一下
    SqlConnection conn = new SqlConnection("server=localhost;database=test;uid=sa;pwd=820704");前提是启用了sa登录,并允许混合模式