就时在sqlconnection配置时 测试连接是成功的
但程序以运行就说我无法登陆?
怎么会事啊?

解决方案 »

  1.   

    是不是自动生成的代码?
    如果是的话请加上pwd="**"
    例:
    this.sqlConnection1.ConnectionString = "workstation id=ZLL;packet size=4096;user id=sa;pwd=123;data source=ZLL;persis" +
    "t security info=False;initial catalog=DMOnline";
      

  2.   

    你的数据库登陆验证是WINDOWS集成身份认证的吧?这样可能出问题的唉改一下试试
      

  3.   

    多谢
    原来自动生成的代码里的connectionstring 里没有password
    所以总是无法登陆
    却总是能测试连接成功