我是C#/ Visual Studio的新手(来自Python背景),正在尝试连接数据库,但是无法导入适当的库。我正在使用Visual Studio 2017并正在创建.NET Core应用程序,并且我有
using System;
using System.Data.OleDb; // this gets greyed out. "Using directive is unnecessary"
public class Program
{
static OleDbConnection conn; //The type or namespace name 'OleDbConnection' could not be found (are you missing a using directive or assembly reference)
}
我可以导入System.Data而不会变灰(尽管仍然找不到OleDbConnection名称),但是我不知道如何导入System.Data.OleDb。
在项目(ConsoleApp1)下的解决方案资源管理器中,有两个项目(Program.cs和Dependencies)。我尝试右键单击依赖项->添加引用,但是在“项目”,“共享项目”或“浏览”文件夹中没有出现任何选项。
我想念什么?