C#应用程序连接到服务器上的数据库 [英] C# app connecting to database on server

查看:138
本文介绍了C#应用程序连接到服务器上的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个使用LINQ to Entities连接到另一台计算机上的数据库的应用程序.我需要配置连接字符串吗?如果是这样,我该怎么做?

I want to write an app that connects to a database on another computer using LINQ to Entities. Do I need to configure a connection string? If so, how do I do this?

推荐答案

这应该只是连接字符串中的一个更改.

但是,您没有使用任何有关数据库引擎的信息,因此无法确切说明更改的外观.通常只是更改字符串的Server或DataSource部分,但这完全取决于您使用的SQL Server.
This SHOULD just be a change in the connection string.

But, you didn''t say anything about the database engine you''re using, so it''s kind of impossible to say exactly what the change should look like. It''s normally just changing the Server or DataSource portion of the string, but that depends entirely on the SQL server that you''re using.


这篇关于C#应用程序连接到服务器上的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆