Tuesday, July 28, 2009

Simple C# question?

Hello thanks for looking at my question, my last question had a great turn out so i've decided to ask another, and again it's probably extremely simple (but difficult for me!). I've had a few people tell me that you can find the entire C# function (Command) library in visual studio. however, i can't seem to find it to access it. if anyone could tell me what exactly i do with visual studio (I'm using visual studio C# 2005) to get to the C# function list, it would be appreciated. however, if you aren't sure about visual studio, but know a good online resource for C# (Specifically functions as they are what i am looking for) please post those as well! thanks in advance!

Simple C# question?
On the View Menu, select Object browser... (not sure if you have to hover on "other windows" or not). This will show you the entire Object Library along with the associated functions, properties and methods for the .NET Framework (2.0 in this case).


To get Intellesense (typing word recognition) to work, you might have to add references to these namespaces in your project. There's a very basic group of namespaces added to every project at creation time. Once you get the reference you need, for the object you're trying to use, you can make intellesense even more convenient by adding using statements at the top of your class definition... eg:





using System.Data.SqlClient;





This will load all non-duplicate objects into the top level of intellesense so if you type the following code:





public DataReader dr;





by the time you get to the D you will be able to scroll through the intellesense popup and find the DataReader object in the list.





Hope this helps.
Reply:You want to use the Object Browser under View menu bar. Object Browser will load up all the Classes in the Base Class Library...every function you could think of will first be wrapped in a class. So whatever you are looking for you have to figure out what Namespace it's categorized in...then what Class it's in...then when you're at the Class level you'll see the methods available to use.





Hope that helps.

innia

No comments:

Post a Comment