为什么即使我已经引用了DAL05.dll,也无法识别SQL Server? [英] Why is SQL Server not recognized, even though I've got a reference to DAL05.dll?

查看:65
本文介绍了为什么即使我已经引用了DAL05.dll,也无法识别SQL Server?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎,每当我向使用 commonClass.vb 文件中的代码的项目添加任何内容时,都会收到有关无法识别SQL Server的错误。



我确实引用了DAL05。



文件中的SQL Server显示无法识别,<$ c也是如此$ c> DAL05.DataAccess 导入:





我需要添加其他参考吗?其他或其他进口商品?还是什么?



如您所见,我引用的是DAL05,它不是作为SQL Server识别的一种方式提供的:





更新



一个可能是重要的事实:遗留项目之间的区别-识别SQL Server没有问题-它甚至没有参考文件夹; DAL05.dll (和 DAL05.pdb )低于 \< project> below \bin\Common



所以我应该强制使用 Bin 和<$ c将$ c> Bin\Common 文件夹放入我的项目中(通过Windows资源管理器),然后在其中添加这些文件?是解决方案(无双关语)吗?



更新2



好吧,现在这真的变得很奇怪。根据我在有关类似问题的



如果有任何含义,则失败的函数是:

 公共函数GetUserInfo(ByVal用户标识为String,ByVal密码为String,ByVal memberno为字符串)作为DataTable 
Dim sqlDAL作为新的SQLServer(System.Configuration.ConfigurationManager.AppSettings( OrderEnterConnection))
Dim dset作为DataSet
dset = sqlDAL.runSQLDataSet( Exec up_GetUserData_Web_2012' + userid +',' +密码+',' + memberno +'))
返回dset.Tables(0)
结束函数

更新3



每个陌生人:在我更改此设置之后:

 导入DAL05.DataAccess 

...到此:

 导入DAL05.DataAccess.SQLServer 

我终于G提供了一些看似明智的Intellisense帮助;它说,


导入DAL05.DataAccess.SQLServer'和其他缺少的引用?


我接受了,但是我仍然遇到204错误。



然后导入DAL05.DataAccess。 SQLServer 完全变灰,具有以下有用的消息:



解决方案

@B。 Clay Shannon (OP)评论说解决方案是:



1)摆脱所有TFS痕迹(.sln文件中的文件和条目);



2)删除.suo文件,并且(可能与它无关)



3)打开Visual Studio以管理员身份。



另一种情况



我遇到了同样的问题,我会执行以下操作步骤



1)关闭所有打开的选项卡,清理所有项目并重建,



2)关闭我所有的Visual Studio实例



3)重新启动计算机。



它解决了问题


It seems that whenever I add anything to my project which uses code in my commonClass.vb file, I get errors about SQL Server not being recognized.

I do have a reference to DAL05.

SQL Server in the file shows it's not recognized, as does the DAL05.DataAccess imports:

Do I need to add another reference? Another or a different Imports? Or what?

As you can see, I am referencing DAL05, and it is not offered as a way for SQL Server to be recognized:

UPDATE:

A possibly significant factoid: A difference between the legacy project - which has no problem with recognizing SQL Server - is that it does not even have a References folder; DAL05.dll (and DAL05.pdb) are below \<project>\bin\Common

So should I force a Bin and Bin\Common folder into my project (via Windows Explorer) and then add those files there? Is that the solution (no pun intended)?

UPDATE 2:

Okay, now this is getting really weird; based on a clue I found here about a similar issue, I prepended DAL095.DataAccess. to the SQL Server like so:

Dim sqlDAL As New DAL05.DataAccess.SQLServer(

The results are as follows:

  1. This does NOT reduce the number of errors.

  2. This seems superfluous/moot because DAL05.DataAccess." is grayed out.

  3. The red underscore on the second and last r of SQLServer is NOT removed.

Yet, when I 2-click the top "Type 'SQLServer' is not defined." error msg from the error list, it no longer takes me to the references to "SQLServer" to which I have appended the seemingly useless "DAL05.DataAccess" but go instead only to the "naked" references to "New SQLServer":

In case it means anything, a failing function is:

Public Function GetUserInfo(ByVal userid As String, ByVal password As String, ByVal memberno As String) As DataTable
    Dim sqlDAL As New SQLServer(System.Configuration.ConfigurationManager.AppSettings("OrderEnterConnection"))
    Dim dset As DataSet
    dset = sqlDAL.runSQLDataSet("Exec up_GetUserData_Web_2012 '" + userid + "','" + password + "','" + memberno + "'")
    Return dset.Tables(0)
End Function

UPDATE 3:

Ever stranger: after I changed this:

Imports DAL05.DataAccess

...to this:

Imports DAL05.DataAccess.SQLServer

I was finally given some seemingly sensible Intellisense help; it said,

Import DAL05.DataAccess.SQLServer' and other missing references?

I accepted that, but I still have the same 204 errors.

And Imports DAL05.DataAccess.SQLServer is completely grayed out, with the following helpful msg:

解决方案

As @B. Clay Shannon (the OP) Commented the solution is:

1) getting rid of all the TFS vestiges (files and entries in the .sln file);

2) Deleting the .suo files and (probably had nothing to do with it)

3) Opening Visual Studio as administrator.

Another Case

I was having the same problem and i does the following steps

1) closing all the open tabs, cleaning all the projects and rebuilding,

2) shutting down all my Visual Studio instances

3) restarting my computer.

and it fixed the issue

这篇关于为什么即使我已经引用了DAL05.dll,也无法识别SQL Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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