如何引用System.Data这在Visual Studio 2015年针对.NET的核心? [英] How to reference System.Data in Visual Studio 2015 targeting .NET Core?

查看:106
本文介绍了如何引用System.Data这在Visual Studio 2015年针对.NET的核心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图访问的IDbConnection 接口一个类库,以使连接并从数据库中提取数据的连接对象,但我就是无法访问的IDbConnection 接口,它应该在 System.Data.dll中

I am trying to access the IDbConnection interface in a class library in order to make a connection object that connects and fetches data from the database, but I just cannot access the IDbConnection interface which was supposed to by in System.Data.dll.

我要通过不能在任何地方的NuGet找到它的。所以,我怎么做呢?

I can't find it anywhere in NuGet either. So, how do I go about it?

微软已经改变了我们建立连接到一个数据库为好,或者是有.NET中的核心引入的任何新接口的方式吗?

Has Microsoft changed the way we make connections to a database as well, or is there any new interface introduced in .NET Core?

推荐答案

的IDbConnection 的IDbCommand 等接口已经从.NET核心的 System.Data.Common 命名空间中删除。他们已经被替换为的DbConnection 的DbCommand 等抽象类。你可以阅读这里此事的讨论。

The IDbConnection, IDbCommand etc. interfaces has been removed from the System.Data.Common namespace in .NET Core. They've been replaced by the DbConnection, DbCommand etc. abstract classes. You can read a discussion on the matter here.

你可以看看在.NET的核心进展 System.Data.Common 此处。在未来,如果你是否类型已经被移动或删除是不确定的,这可能是检查的好地方。

You can take a look at the .NET Core progress for System.Data.Common here. In the future, if you're uncertain whether types have been moved or removed, this might be a good place to check.

您想安装的NuGet包< A HREF =https://www.nuget.org/packages/System.Data.Common> System.Data.Common 时,它包含上述类型

The NuGet package you want to install is System.Data.Common, which contains the mentioned types.

这篇关于如何引用System.Data这在Visual Studio 2015年针对.NET的核心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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