SqlConnection conn = new SqlConnection(@"Data Source=.\WaltzPC;Initial Catalog=test;UserID=sa;Password=123");SqlConnection conn = new SqlConnection("Data Source=localhost;Initial Catalog=test;UserID=sa;Password=123");

解决方案 »

  1.   

    在语句中加上这个条件
    Provider = SQLOLEDB.1;
      

  2.   

    SQL 2000:
    static string StrConn = "workstation id=202.134.127.77;data source=202.134.127.77;initial catalog=Yellowpage;user id=sa;password=grt2006";SQL2005:
     con = new SqlConnection(@"Server=.\SQLExpress;Database=db_CMS;Persist Security Info=True;User ID=sa;Password=Masslong");ACCESS:
    string StrConn = "provider=Microsoft.Jet.OLEDB.4.0;" + "data source="+AppPath+"\\Combination.mdb";
      

  3.   

    Server=机器名\实例名;Database=数据库;ID=实据库用户名;PWD=密码(因该是不小于4位的)