server=192.168.0.99--->端口呢?

解决方案 »

  1.   

    using System.Data.Sqlcilent;加了吗?
      

  2.   

    未处理的“System.Data.SqlClient.SqlException”类型的异常出现在 system.data.dll 中。其他信息: 系统错误。
    这是异常信息!!
      

  3.   

    try
    {}
    catch (System.Exception ex)
    {
    MessageBox.Show(ex.ToString());
    }
    把代码放到try里,你再把异常贴出来看看
      

  4.   

    请问搂住你是否指定了DATAMENBER
    还有你最好把抛出的异常贴出来
      

  5.   

    是不是和防火墙有关,你是在XP上开发吗?XP上有没有开启任何的防火墙?
      

  6.   

    或者192.168.0.99上的SQL Server运行正常吗?
      

  7.   

    服务器运行正常,我是在2000 pro上开发的,异常上面已经贴出来了,我没有装防火墙!!
      

  8.   

    string cString = "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer";
          SqlConnection myConnection = new SqlConnection(cString);
          // Create a SqlDataAdapter.
          SqlDataAdapter myAdapter = new SqlDataAdapter();
          myAdapter.TableMappings.Add("Table", "Suppliers");
          myConnection.Open();
          SqlCommand myCommand = new SqlCommand("SELECT * FROM Suppliers",
          myConnection);
          myCommand.CommandType = CommandType.Text;
       
          myAdapter.SelectCommand = myCommand;
          Console.WriteLine("The connection is open");
          ds = new DataSet("Customers");
          myAdapter.Fill(ds);
          // Create a second Adapter and Command.
          SqlDataAdapter adpProducts = new SqlDataAdapter();
          adpProducts.TableMappings.Add("Table", "Products");
          SqlCommand cmdProducts = new SqlCommand("SELECT * FROM Products", 
          myConnection);
          adpProducts.SelectCommand = cmdProducts;
          adpProducts.Fill(ds);
          myConnection.Close();
          Console.WriteLine("The connection is closed.");
          System.Data.DataRelation dr;
          System.Data.DataColumn dc1;
          System.Data.DataColumn dc2;
          // Get the parent and child columns of the two tables.
          dc1 = ds.Tables["Suppliers"].Columns["SupplierID"];
          dc2 = ds.Tables["Products"].Columns["SupplierID"];
          dr = new System.Data.DataRelation("suppliers2products", dc1, dc2);
          ds.Relations.Add(dr);