如何将Visual Studio 2010 Express C#连接到SQL Server Express [英] How to connect Visual Studio 2010 Express C# to SQL Server Express

查看:277
本文介绍了如何将Visual Studio 2010 Express C#连接到SQL Server Express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了将允许的轻量级选项(Access,SQL Compact或SQL文件)之外,是否有任何真正的解决方法来使Express Edition C#连接到数据库选项?正如其他地方所指出的,在网络版中也可以这样做.还应注意,您可以创建一个项目文件,在Web版本中将其打开,创建一个连接,并使用您的数据库实体创建一个项目,然后切换回C#.

Is there any real workaround to getting the Express edition of C# connected to database options other than the lightweight options allowed (Access, SQL Compact, or SQL file)? As has been noted elsewhere, it's possible in the web edition to do so. It has also been noted that you can create a project file, open it in the web edition, create a connection, and create a project with your database entities, and then switch back to C#.

但是,作为一种解决方法,这很笨拙,好像我可以将SQL连接持久保存在我的C#数据库浏览器中一样,它似乎是与应用程序绑定的,而不是与任何项目绑定的,那么我将永远是能够添加到数据库中,而不必不断地来回切换.

However, as a workaround this is quite clunky, as it seems like if I could just get the SQL connection persisted in my C# Database Explorer, which seems to be tied to the application, not any project, then I would permanently be able to add to the database without having to constantly switch back and forth.

有人解决过这个问题吗?

Has anyone worked through this problem?

推荐答案

我想出了一个更好的解决方法.应用程序设置似乎保存在[文档和设置] \ [用户] \ Application \ Microsoft \ VCSExpress \ 10.0和VWDExpress \ 10.0中.我发现在WD中创建连接后,将ServerExplorer \ DefaultView.SEView从VWDExpress复制到VCSExpress可以正常工作.我可以从那里创建新对象,从数据刷新,从设计中创建数据库,等等.

I figured out a better workaround. The application settings seem to be saved in [Documents and Settings]\[User]\Application\Microsoft\VCSExpress\10.0 and VWDExpress\10.0. What I found is copying ServerExplorer\DefaultView.SEView from the VWDExpress to VCSExpress after creating the connection in WD worked perfectly. I could from there create new objects, refresh from the data, create a database from the design, etc.

这篇关于如何将Visual Studio 2010 Express C#连接到SQL Server Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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