简体   繁体   English

是否有用于连接到客户端计算机的连接字符串

[英]Is There a Connection String For Connecting to Client Machine

I installed a windows form application on a client computer but when I try to log into my application it gives me this error:我在客户端计算机上安装了 windows 表单应用程序,但是当我尝试登录我的应用程序时,它给了我这个错误:

a connection was successfully established with the server, but then an error occurred during the login process.与服务器成功建立连接,但在登录过程中发生错误。 (provider: shared memory provider, error: 0- No process is on the other end of the pipe.) (提供者:共享 memory 提供者,错误:0- pipe 的另一端没有进程。)

This is a c# windows form application running with SQL Server database, with login details.这是与 SQL 服务器数据库一起运行的 c# windows 表单应用程序,带有登录详细信息。 I have added the in and out bound rule on my firewall, I have tried changing my connection string severally, I have enabled tcp/ip port with its default port number, I have tried using the same network for both computers, I have tried using window and sql authentication, I have disabled firewall on client computer我已经在我的防火墙上添加了入站和出站规则,我已经尝试分别更改我的连接字符串,我已经使用默认端口号启用了 tcp/ip 端口,我尝试为两台计算机使用相同的网络,我尝试使用window 和 sql 身份验证,我在客户端计算机上禁用了防火墙

Here is my connection string这是我的连接字符串

<add name="connstrng" connectionString="Data Source=(local);Initial Catalog=AnyStore;Integrated Security=True"/>

I expect to be logged in to my application on the client computer using the same database with my server computer.我希望使用与服务器计算机相同的数据库登录到客户端计算机上的应用程序。

Connection strings are usually defined within the Web.config file.连接字符串通常在 Web.config 文件中定义。 As @Panagiotis Kanavos said, the string is connecting to a local data source, which should work as expected within your dev environment.正如@Panagiotis Kanavos 所说,该字符串正在连接到本地数据源,它应该在您的开发环境中按预期工作。 The web.config file should be located within the root directory of your project. web.config 文件应位于项目的根目录中。 Edit this file on the client's machine to point to the expected server / database.在客户端机器上编辑此文件以指向预期的服务器/数据库。 You may want to keep a blank or default version of this file in source control to avoid overwriting other's connection string info.您可能希望在源代码管理中保留此文件的空白或默认版本,以避免覆盖其他连接字符串信息。

Example String:示例字符串:

<add name="SomeDB" connectionString="Data Source=snapdragon\SQL2k14;database=DBNAME;User Id=username; password=password" providerName="System.Data.SqlClient" />

Edit: "snapdragon" would be the host computer name.编辑:“snapdragon”将是主机名。 "SQL2k14" would be your sql server instance. “SQL2k14”将是您的 sql 服务器实例。

ok, i found the solution i changed my connection string and its working fine now, thanks guys.好的,我找到了解决方案,我改变了我的连接字符串,现在它工作正常,谢谢大家。 here is my connection string-这是我的连接字符串-

<connectionStrings>
  <add name="connstrng" connectionString="Data Source=DESKTOP-5I8TFY3\EMEKA;Initial Catalog=AnyStore;User ID=adminpos;Password=********" />
</connectionStrings>
</configuration>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在连接字符串中添加数据目录以在客户端计算机上部署应用程序? - How to add data directory in connection string to deploy application on client machine? 连接到客户端计算机上的数据库时发生异常 - Exception when connecting to database on client machine 如何使用数据库部署C#Windows应用程序(安装文件)以及如何在客户端计算机上管理连接字符串 - How to deploy C# windows application (setup file) with database and how to manage connection string on client machine 通过连接字符串连接到远程数据库 - Connecting to a remote database via a connection string 是使用SqlConnection()和连接字符串安全连接到数据库? - Is connecting to a database using SqlConnection() AND a Connection string safe? 连接数据库时连接字符串无效 - Invalid connection string when connecting to database 使用客户端计算机的格式将字符串转换为dateTime - Converting string To dateTime using the format of the Client Machine 检查TcpListener是否可用于接受来自客户端的连接而无需立即连接 - Check if TcpListener is available to accept connection from client without connecting immediately Java客户端连接到C#服务器:连接超时 - Java-Client connecting to C# Server: Connection Timeout SQL 服务器连接客户端到服务器时远程连接出错 - Error in remote connection in SQL Server when connecting the client to the server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM