With over 45,000 topics, finding what you need in the Visual Studio .NET documentation can be a daunting task. The Doc Detective is here to help, utilizing his investigative skills to probe the depths of the documentation.

The Doc Detective

Can't find what you're looking for? Just ask?if it's in there, I'll find it for you; if it isn't, I'll let you know that as well (and tell you where else you might go to find it).

Have a question for the Doc? Send your questions for future columns to me at docdetec@microsoft.com.

Dear Doc Detective,

I need to read and write files in Visual Basic .NET and I don't even know where to start. Someone suggested using streams for file input and output. What's up with that? I always thought that streams were for fishing.

-Konfounded in Kalispell

Dear Konfounded,

Admittedly, the documentation on File I/O is a little fishy. The topic "Reading Text from a File" provides an example, but not much else. There is, however, a recent whitepaper in the MSDN Library (http://msdn.microsoft.com/library) entitled "Choosing Among File I/O Options in Visual Basic .NET" that describes several different options for File I/O, along with copious examples of each. As for me, I'd rather be fishing.

-The Doc

Dear Doc Detective,

I'm creating some Web Forms in an ASP.NET application and I want to store some user information in a cookie. This seems like a simple thing, but I can't seem to find any documentation on how to do it.

-Cookieless Monster

Dear Cookieless,

The documentation on how to create a cookie does seem to be very... secure. There is example code showing how to create a cookie in the topic "HttpResponse.Cookies Property." Another place to find information on cookies is in some of the .NET sample applications. For example, the IBuySpy sample (http://www.ibuyspystore.com) is a running application that shows you its source code. (Click the link for documentation at the bottom left of the default page.) For example, if you go to the IBuySpy documentation and follow the link for the Default page, you'll see an example of how that application uses cookies.

-The Doc Detective

Dear Doc Detective,

When I use Search to look for some information, I frequently get back a result list with 500 items in it. That's way too much for me to dig through. How can I get more useful results?

-Overwhelmed in Omaha

Dear Overwhelmed,

If one topic is useful, 500 topics should be 500 times as useful. If not, there are several ways to reduce the size of your result lists.

A phrase enclosed in quotation marks will be searched for as a single string, whereas a phrase that is not enclosed in quotation marks is treated as a set of terms joined by AND operators. Any article that contains all the words in the phrase will make the results list, regardless of how close together those words are.

One-word searches are especially prone to large result lists, due to the number of articles available. Searching for a phrase or even a set of related words will make the results list shorter and more relevant.

You can use the following logical operators in your search criteria: AND, OR, NOT, THRU, NEAR. For more information, see the Help topic named "Logical Operators in Search Expressions."

You can use the "Search in titles only" check box to reduce the size of the results list. By searching only the article titles, you are limiting the scope of hits to those where your term is part of the main idea of the articles found.

Use the choices in the "Filtered by" box to narrow the scope of articles that are searched. For example, if you are programming with Visual Basic, choose the "Visual Basic and related" filter before searching. (The "and related" part of the filter name means that the search engine will scan not only the Visual Basic language documentation, but the .NET Framework and Internet Development documentation as well.) Note that the filter also applies to the Contents and Index of the documentation, narrowing the scope of articles available through those mechanisms.

For more information on using Search, see the Help topic named "Finding Information with Full-Text Search." Search for that title by enclosing the string in quotation marks and choosing the "Search in titles only" option, and you'll get a one-item result list.

-Doctor D

Dear Doc Detective,

I'm building my first User Control in Visual Basic .NET and I can't figure out how to persist the control between uses. In Visual Basic 6, I could do this with a Property Bag object and the ReadProperties and WriteProperties methods, but I can't see any equivalents for these in .NET. I've been reading through some threads on the newsgroups that talk about serialization, but that just confused me even more.

-Bagless in Birmingham

Dear Bagless,

Just as your local supermarket gives you a choice between paper and plastic, .NET gives you a choice between binary and SOAP serialization to persist your control. While there isn't anything in the documentation specifically related to User Controls, the topic "Serializing Objects" may be of help. There is also a whitepaper in the MSDN Library (http://msdn.microsoft.com/library) that shows how to replace your PropertyBag functionality using serialization?just search for "Property Bag Changes in Visual Basic .NET."

-D. Detective

Doc's Doc Tip of the Day

When you get a list of search results, the items are "ranked" by how many times the search terms occur in each article. But you can easily rearrange the list to find the items most relevant to you. The Location column of the results list names the product or feature area in which an article belongs. Click the Location column heading to alphabetically sort your result list by Location name. Once you've done this, you can easily see the group of articles related to the product, language, or technology that is most relevant to you. Likewise, you can click the Title column heading to alphabetically sort the results by article title. This can be helpful if you remember the name of an article you are looking for but are having trouble picking it out of a long list of articles.

Found the topic in the docs, but it doesn't answer your question? Tell the Visual Studio documentation team about it at vsdocs@microsoft.com.