简体   繁体   English

如何在C#中使用SQL Server数据库以通过网络共享

[英]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.

相关问题 如何通过网络将单个SQL Server数据库连接到两个不同的C#WPF应用程序 - how to connect a single SQL server database to two different C# WPF applications over the network 网络上的SQL Server和C#应用程序 - SQL server and c# applications over network 哪些C#数据库支持共享网络上的多重连接? - What C# database support multi connections over shared network? 如何使可移植exe程序(C#)在本地网络上使用数据库(SQL Server Express) - How to make portable exe program (C#) use a database (SQL Server Express) on a local network 如何通过网络从C#ClickOnce应用程序访问SQL Server 2008 R2 - How to access sql server 2008 R2 from C# ClickOnce application over a network 如何使用C#删除“正在使用”的SQl Server数据库? - How To Delete SQl Server database while it is “In Use” using C#? 如何打开与C#中已在使用的SQL Server数据库的连接? - How to open a connection to a SQL Server database that is already in use in c#? 在C#WAF中的网络上创建SQL Server数据库 - Creating a SQL Server database on a network in C# WAF 如何在互联网上安全地使用Entity Framework / C#和SQL Server - How to use Entity Framework/C# and SQL Server over the internet securely C#在多台PC上使用一个SQL Server数据库 - C# Use One SQL Server database on multiple PC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM