简体   繁体   English

Visual Studio Server Explorer是否支持自定义数据库提供程序?

[英]Does Visual Studio Server Explorer support custom database providers?

I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. 在我的一些学习项目中,我曾使用Server Explorer和相关工具通过Microsoft SQL Server进行图形数据库开发-这是一次很棒的经历。 However, in my work I deal with Oracle DB and SQLite and my hobby projects use MySQL (because they are hosted on Linux). 但是,在我的工作中,我处理Oracle DB和SQLite,而我的业余项目使用MySQL(因为它们托管在Linux上)。

Is there a way to leverage the database-related tools in Visual Studio with other database providers? 有没有一种方法可以将Visual Studio中与数据库相关的工具与其他数据库提供程序一起使用?

Here is instructions on how to connect to your MySQL database from Visual Studio: 这是有关如何从Visual Studio连接到MySQL数据库的说明:

To make the connection in server explorer you need to do the following: 要在服务器资源管理器中建立连接,您需要执行以下操作:

  • first of all you need to install the MyODBC connector 3.51 (or latest) on the development machine (NB. you can find this at http://www.mysql.com/products/connector/odbc/ ) 首先,您需要在开发计算机上安装MyODBC连接器3.51(或最新版本)(注意:您可以在http://www.mysql.com/products/connector/odbc/上找到它)

  • Create a datasource in Control Panel/Administrative Tools with a connection to your database. 在“控制面板/管理工具”中创建与数据库连接的数据源。 This data source is going to be used purely for Server Manager and you dont need to worry about creating the same data source on your clients PC when you have made your VS.NET application (Unless you want to) - I dont want to cover this in this answer, too long. 此数据源将仅用于服务器管理器,并且在制作VS.NET应用程序时,您不必担心在客户端PC上创建相同的数据源(除非您愿意)-我不想讨论这个问题。在这个答案中,时间太长。 For the purpose of this explanation I will pretend that you created a MyODBC data source called 'AADSN' to database 'noddy' on mysqlserver 'SERVER01' and have a root password of 'fred'. 出于解释的目的,我将假设您在mysqlserver'SERVER01'上为数据库'noddy'创建了一个名为'AADSN'的MyODBC数据源,其根密码为'fred'。 The server can be either the Computer Name (found in Control Panel/System/Computer Name), or alternatively it can be the IP Address. 服务器可以是计算机名称(在“控制面板/系统/计算机名称”中找到),也可以是IP地址。 NB. 注意 Make sure that you test this connection before continuing with this explanation. 在继续此说明之前,请确保您测试了此连接。

  • open your VS.NET project 打开您的VS.NET项目

  • go to server explorer 转到服务器资源管理器

  • right-click on 'Data Connections' 右键单击“数据连接”

  • select 'Add Connection' 选择“添加连接”

  • In DataLink Properties, go to the provider tab and select "Microsoft OLE DB Provider For ODBC drivers" 在“ DataLink属性”中,转到提供程序选项卡,然后选择“用于ODBC驱动程序的Microsoft OLE DB提供程序”

  • Click Next 点击下一步

  • If you previously created an ODBC data source then you could just select that. 如果您以前创建了ODBC数据源,则可以选择它。 The disadvantage of this is that when you install your project application on the client machine, the same data source needs to be there. 这样做的缺点是,当您在客户端计算机上安装项目应用程序时,需要相同的数据源。 I prefer to use a connection string. 我更喜欢使用连接字符串。 This should look something like: 看起来应该像这样:

DSN=AADSN;DESC=MySQL ODBC 3.51 Driver DSN;DATABASE=noddy;SERVER=SERVER01;UID=root;PASSWORD=fred;PORT=3306;SOCKET=;OPTION=11;STMT=; DSN = AADSN; DESC = MySQL ODBC 3.51驱动程序DSN; DATABASE = noddy; SERVER = SERVER01; UID = root; PASSWORD = fred; PORT = 3306; SOCKET =; OPTION = 11; STMT =;

If you omit the password from the connection string then you must make sure that the datasource you created (AADSN) contains a password. 如果从连接字符串中省略密码,则必须确保创建的数据源(AADSN)包含密码。 I am not going to describe what these mean, you can look in the documentation for myodbc for that, just ensure that you get a "Connection Succeeded" message when you test the datasource. 我不会描述这些含义,您可以在myodbc的文档中查找,只是确保在测试数据源时收到“连接成功”消息。

I found this during my research on Sqlite. 我在研究Sqlite时发现了这一点。 I haven't had the chance to use it though. 我还没有机会使用它。 Let us know if this works for you. 让我们知道这是否适合您。

http://sqlite.phxsoftware.com/ http://sqlite.phxsoftware.com/

System.Data.SQLite System.Data.SQLite is the original SQLite database engine and a complete ADO.NET 2.0 provider all rolled into a single mixed mode assembly. System.Data.SQLite System.Data.SQLite是原始SQLite数据库引擎和完整的ADO.NET 2.0提供程序,所有这些程序都集成到单个混合模式程序集中。

... ...

Visual Studio 2005/2008 Design-Time Support Visual Studio 2005/2008设计时支持

You can add a SQLite connection to the Server Explorer, create queries with the query designer, drag-and-drop tables onto a Typed DataSet and more! 您可以将SQLite连接添加到Server Explorer,使用查询设计器创建查询,将表拖放到Typed DataSet等上!

SQLite's designer works on full editions of Visual Studio 2005/2008, including VS2005 Express Editions. SQLite的设计师可以使用Visual Studio 2005/2008的完整版本,包括VS2005 Express Edition。

NEW You can create/edit views, tables, indexes, foreign keys, constraints and triggers interactively within the Visual Studio Server Explorer! 新增功能您可以在Visual Studio Server Explorer中以交互方式创建/编辑视图,表,索引,外键,约束和触发器!

The Server Explorer should support any database system that provides an ODBC driver. 服务器资源管理器应支持任何提供ODBC驱动程序的数据库系统。 In the case of Oracle there is a built in driver with Visual Studio. 对于Oracle,Visual Studio有一个内置驱动程序。

In the Add Connection Dialog click the change button on the data source you should then get a list of the providers you have drivers for. 在“添加连接”对话框中,单击数据源上的“更改”按钮,然后应获得具有驱动程序的提供程序的列表。

Oracle has a set of tools that integrates with Visual Studio. Oracle有一套与Visual Studio集成的工具。 It's packaged with their data access libraries. 它与他们的数据访问库打包在一起。

http://www.oracle.com/technology/software/tech/windows/odpnet/index.html http://www.oracle.com/technology/software/tech/windows/odpnet/index.html

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

相关问题 Visual Studio 2013 Server Explorer自定义数据提供程序:MongoDB - Visual Studio 2013 Server Explorer custom data provider: MongoDB Visual Studio Server资源管理器连接到数据库,但是在代码中引发了异常 - Visual Studio Server Explorer connects to database but in code an exception is thrown Visual Studio Shell 2015不在解决方案资源管理器中使用自定义图标 - Visual Studio Shell 2015 does not use custom icons in solution explorer Visual Studio 2015 Express Web版是否支持SQL Server Compact? - Does Visual Studio 2015 Express for Web support SQL Server Compact? 项目内部的MDF数据库。 Visual Studio Server资源管理器不显示对数据的更改 - MDF database inside project. Visual Studio Server Explorer not showing changes to the data “ClickOnce 不支持”visual studio Bug? - "ClickOnce does not support" visual studio Bug? Visual Studio社区是否支持“添加为链接”? - Does Visual Studio Community support “Add as Link”? Visual Studio,Server Explorer无法建立与Microsoft SQL Server的连接 - Visual Studio, Server Explorer Cannot Establish Connection to Microsoft SQL server 使用Visual Studio服务器资源管理器连接到远程SQL Server 2012 - Connect to remote SQL server 2012 using visual studio server explorer 在Visual Studio 2012 Express for Web中找不到服务器资源管理器 - Cannot find server explorer in Visual Studio 2012 express for web
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM