C# 当我使用没有连接字符串的服务器资源管理器时,如何在客户端系统中安装我的应用程序

C# 当我使用没有连接字符串的服务器资源管理器时,如何在客户端系统中安装我的应用程序,c#,linq-to-sql,database-connection,server-explorer,C#,Linq To Sql,Database Connection,Server Explorer,我在Sql类中添加了一个Linq,在server explore中,我在系统中附加了我的Sql server名称和数据库。已在app.Config文件中自动创建连接字符串。除此之外,我没有在任何地方写入任何连接字符串。我正在创建DataContext类对象并使用数据库中的数据 DataContext类 DtContext.purchasesDtlsDataContext purchasesDC = new slsandPchsLib.DtContext.purchasesDtlsDataCon

我在Sql类中添加了一个Linq,在server explore中,我在系统中附加了我的Sql server名称和数据库。已在app.Config文件中自动创建连接字符串。除此之外,我没有在任何地方写入任何连接字符串。我正在创建DataContext类对象并使用数据库中的数据

DataContext类

 DtContext.purchasesDtlsDataContext purchasesDC = new slsandPchsLib.DtContext.purchasesDtlsDataContext();
从数据库检索数据

 var goods = from gds in purchasesDC.goodsrcpts_rd(Id) select gds;
 var goodsDtls = from dtls in purchasesDC.goodsrcptsdtls_rd(Id) select dtls;
由于这个原因,我在电脑方面做得很好。现在我正在尝试在另一台(客户端)计算机上使用我的应用程序。我已将数据库连接到sqlServer,并更改了App.Config文件DataSource中的服务器名称。我仍然无法连接到数据库。我得到一个错误,因为

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
我怎样才能解决我的问题

app.config中的连接字符串是

  <connectionStrings>
    <add name="slsandPchsLib.Properties.Settings.SalesPrchsConnectionString"
        connectionString="Data Source=CENSYS07\SQLEXPRESS;Initial Catalog=SalesPrchs;Integrated Security=True"          
        providerName="System.Data.SqlClient" />
</connectionStrings>

导致此错误的原因是
dbml
文件中的表来自不同的数据库,而
app.config
中的
连接字符串属于不同的数据库

请使用app.config文件中的
连接字符串检查您的数据库属性

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

正如您所知,发生此错误的原因是系统无法找到您在app.config中提到的数据库名称。

No sir。。我已经添加了相同的数据库并更改了连接字符串。。但我还是遇到了同样的问题您的数据库存在于同一台机器上或不同的机器上?请粘贴您的连接字符串?您的数据库是否有用户名密码?问题是您的计算机无法在系统中找到数据库“SalesPrchs”。