简体   繁体   English

我的客户端上的应用程序如何与服务器上的数据库进行通信

[英]How could my application on client communicate database on server

I am working on windows forms application using c#.net. 我正在使用c#.net开发Windows窗体应用程序。 i have developed an application(3-tier) that uses sql database as backend. 我已经开发了一个使用sql数据库作为后端的应用程序(3层)。 i need to deploy the database on server and my app. 我需要在服务器和我的应用程序上部署数据库。 on client machine. 在客户端计算机上。 but how could my application communicate with database on server. 但是我的应用程序如何与服务器上的数据库通信。 please guide me. 请指导我。

you need a connection string that works fine during development. 您需要一个在开发过程中正常工作的连接字符串。 On your development machine if the application is connecting fine to the database server, chances are that on your client machine, it would work as well. 在您的开发机器上,如果应用程序可以很好地连接到数据库服务器,则在您的客户端机器上,它也可能正常工作。 Sometimes, the problem occurs with the credentials that you use, that might work on the development machine but on the client it wont connect due to the lack of access rights. 有时,您使用的凭据会出现问题,该凭据可能在开发计算机上可用,但由于缺少访问权限,在客户端上无法连接。 so you need to make sure that you give proper credentials to connect to the SQL server 因此,您需要确保提供正确的凭据才能连接到SQL Server

You don't need to do any rocket science for this. 您不需要为此做任何火箭科学。 All you need to do is on the client side use the proper connection string that can connect to a remotely installed SQL Server. 您需要做的就是在客户端使用可以连接到远程安装的SQL Server的正确连接字符串。

Use EntityFramework for your sql server connection for updating, inserting and deleting. 将EntityFramework用于SQL Server连接以进行更新,插入和删除。 Use storedprocedures for the insert/update/delete functions. 将存储过程用于插入/更新/删除功能。

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

相关问题 Tcp服务器/客户端应用程序与其他PC进行通信 - Tcp Server/Client Application to communicate with other PCs 如何在Windows服务器上的PHP和我的应用程序之间进行通信 - How to communicate between php and my application on windows server Telnet服务器如何与客户端通信? - How does Telnet server communicate to the client? 如何在客户端机器上使用 SQL 服务器数据库部署 WinForms 应用程序 - How to deploy WinForms application with SQL Server database on client machine 在服务器和客户端之间交流进度 - Communicate progress between server and client 如何使用udp从c#客户端与c服务器通信? - how to communicate with c server from c# client using udp? 如何在CE 6.0设备(作为服务器)和PC(作为客户端)之间进行通信 - How to communicate between CE 6.0 device (as server) and PC (as client) 如何使用ASP.NET Hosting在Nancy中使用SignalR将服务器与客户端通信? - How to communicate Server to Client with SignalR in Nancy with ASP.NET Hosting? 客户端Flash(SWF)应该如何与服务器端.NET通信? - How should client Flash(SWF) communicate with server-side .NET? 无法创建SSL / TLS安全通道。客户端和服务器无法通信,因为它们没有通用算法 - Could not create SSL/TLS secure channel. The client and server cannot communicate, because they do not possess a common algorithm
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM