[英]How to use SQL Server database in C# to be shared over a network
I have a C# application designed to share a SQL Server database over a network. 我有一个C#应用程序,旨在通过网络共享SQL Server数据库。 The server is installed on my PC, and the application is to be deployed to another pc. 该服务器已安装在我的PC上,并且该应用程序将部署到另一台PC。 The connection string I use is as follows: 我使用的连接字符串如下:
Data Source=Elias\\SqlExpress;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword; Secured connection:true;
to test a connection string you can use a .udl
file. 要测试连接字符串,可以使用.udl
文件。 Create in your desktop a file (right clic -> new-> .txt) and save it like .udl extension . 在桌面上创建一个文件(右clic-> new-> .txt),然后将其保存为.udl extension 。 Now open it and you can configure a connection with differents parameters, and you can test it!. 现在打开它,您可以配置具有differents参数的连接,并且可以对其进行测试!
when you finish the test if you open that .udl
file with notepad
you get the connection string. 如果使用notepad
打开该.udl
文件,则完成测试时,将获得连接字符串。
hope this help! 希望对您有所帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.