找不到类型或命名空间名称“SqlConnection” [英] The type or namespace name 'SqlConnection' could not be found

查看:1145
本文介绍了找不到类型或命名空间名称“SqlConnection”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我是新手,我最近遇到了SqlConnection和SqlClient的问题。 

之后阅读很多帖子,其中大部分问题都是缺少的使用
声明,我只是希望我能在这里得到一些帮助。



我收到下一个错误:' 无法找到类型或命名空间名称'SqlConnection '
尝试创建SqlConnection时',即使包含
' 使用System.Data.SqlClient '在我的文件中。


使用语句中没有错误但是,我得到一个奇怪的(灰色)信息说明
'使用指令是不必要的'。



我错过了什么吗?我刚刚忘记了要安装的功能吗? 
$




我真的很感谢这方面的帮助,

非常感谢!

解决方案

我错过了什么吗?我刚忘了要安装的功能吗? 


很可能    System.Data.SqlClient.DLL不在Bin文件夹中,并且你没有在项目中设置对DLL的引用。


Hi,

I'm new and I recently encountered an issue with SqlConnection and SqlClient. 
After reading alot of posts where mostly the issue was the missing using statement, I'm only hoping I'll get some help here.

I'm getting the next error: 'The type or namespace name 'SqlConnection' could not be found' when trying to create a SqlConnection, even if including 'using System.Data.SqlClient' in my file.

There is no errors in the using statement but altough, I'm getting a weird (grey) info note saying 'Using directive is unnecessary'.

Am I missing something? Did I just forgot a feature to install? 


I'd really appreciate help on this,
thanks alot!

解决方案

Am I missing something? Did I just forgot a feature to install? 

Most likely the  System.Data.SqlClient.DLL in not in the Bin folder, and you have not set reference to the DLL in the project.


这篇关于找不到类型或命名空间名称“SqlConnection”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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