在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接) SqlConnection thisConnection = new SqlConnection(
@"Data Source=192.168.10.67;Initial Catalog=Asaap;User Id=sa;Password=sa;");
SqlDataAdapter thisAdapter = new SqlDataAdapter(
strSQL, thisConnection);
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
DataSet Ds1 = new DataSet(); thisAdapter.Fill(Ds1);
thisAdapter.Dispose();
thisConnection.Close();thisAdapter.Fill(Ds1);这句错
@"Data Source=192.168.10.67;Initial Catalog=Asaap;User Id=sa;Password=sa;");
SqlDataAdapter thisAdapter = new SqlDataAdapter(
strSQL, thisConnection);
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
DataSet Ds1 = new DataSet(); thisAdapter.Fill(Ds1);
thisAdapter.Dispose();
thisConnection.Close();thisAdapter.Fill(Ds1);这句错
你SQL2005建立的是数据库引擎连接吗?
开始/程序/Microsoft SQL Server 2005/配置工具/sql server外围应用配制器
里面配制一下,可以让远程访问