Click here to Skip to main content
15,909,030 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This happens somewhat frequently in Visual Studio, and the current permutation is, "cannot resolve symbol 'SQL Server'" on this line:

VB
Dim sqlDAL As New SQLServer()


Hovering over the unresolved symbol sometimes affords a "resolve" context menu item, but not always (and not this time).

It seems to me that more help should be provided in a scenario such as this - which assembly/reference/DLL do I need to add? I realize that for 3rd party stuff this might be a little tougher, but when the class/symbol in question is apparently a Microsoft-provided one, why can't it let me know "SQL Servr is found in such-and-such a .DLL" at the very least?

That is a semi-rant, and the crux of the question is: since such help is *not* provided, how can I determine which assembly/reference/DLL I need to add?

There must be a list somewhere that contains this, but I couldn't find it...

What I have tried:

Hovering over "SQLServer" gave no clues/help; boogling (I use both google and bing) for the answer didn't turn anything up, either.
Posted
Updated 5-May-16 14:28pm
Comments
Richard MacCutchan 5-May-16 14:07pm    
If you check the documentation page for the class in question it should tell you there. Is SQLServer a valid .NET class?

Well...in this case it's probably because SQLServer isn't a "known" class which is part of a Microsoft Assembly. Or if it is, it's not listed on MSDN.
SqlConnection is
SqlCommand is
SqlDataAdapter is.

But SQLServer isn't - if it exists in your app, it's in a non-Microsoft assembly. And that is part of the problem. Which assembly should it tell you to use? Many many projects will "recycle" class names within an assembly, and the only way to tell which assembly you want is to...reference the right assembly. Once you do that, it can - and does - provide you with options to indicate which one you want to use because there can be multiple classes of the same name in different namespaces (Which could all be in the same assembly).

So why would you expect it to scan every assembly available to you and say "did you mean this one, or this one, or ..."?
 
Share this answer
 
v2
If the required Assembly is in the Global Assembly Cache you can use Object Browser in Visual Studio.
How to locate a specific object - for example SqlCommand
Open a new instance of Visual Studio
Select Object Browser from the View menu
In the Browse box, select All Components
In the Search box enter 'sqlcommand' (without the quotes, case insensitive search)
Select the first item in the results tree (the left panel)
In the bottom right panel you can use the displayed links to traverse up the tree to the actual assembly - at the top level it will show you the actual DLL name

Kind Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900