MVC4项目连接到外部SQL Server [英] MVC4 project connect to external SQL Server

查看:83
本文介绍了MVC4项目连接到外部SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也是MVC4的新手.

对于项目,我想连接到不是本地的SQL Server.
我正在使用Visual Studio 2010和SQL Server 2008 R2 Developer.
该项目是MVC4和C#.

我已经使用SQL Server Management Studio创建了一个数据库,但是没有表.
现在,我发现必须在Visual Studio的web.config中使用connectionString.但是我不知道要填写什么.我已经看过SQL Server 2008下的www.connectionstring.com.但是我不知道希望有一个好的选择以及如何处理外部/远程SQL.服务器2008 R2!

连接字符串是连接数据库的唯一操作吗?

Hi I''m new here and I''m new too MVC4.

For a project I want to connect to a SQL Server thats not local.
I''m using Visual studio 2010 and SQL Server 2008 R2 Developer.
The project is MVC4 and C#.

I''ve created a Database with SQL Server Management Studio but without tables.
Now, I figured out that I have to use an connectionString in web.config in Visual Studio. But I don''t know what to fill in.. I''ve looked at www.connectionstring.com under SQL Server 2008. But I don''t know wish one is good and what to do with an external/ remote SQL server 2008 R2!

And is the connectionstring the only thing to do to connect to a database?

Thanks in advance!

推荐答案

是的,您的连接字符串必须指向SQL Server实例,只要它是本地的,就没有什么区别,只要是Web服务器可以看到它
Yes, your connection string must point to the SQL Server instance, it makes no difference if it''s local, so long as the web server can see it


这篇关于MVC4项目连接到外部SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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