Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Ask the Doc Detective


advertisement
ear Doc Detective, I'm new to .NET and I'm having difficulty understanding how to connect to an Access database. All of the walkthroughs and examples seem to use SQL Server, but I don't have SQL Server. Is there anything that can show me how to access my Access database with .NET?

—Accessible in Akron Dear Accessible,

You're not alone! Accessing Access databases is a very common scenario for Visual Studio .NET, but you're right, the examples do seem to favor SQL Server. There are some minor differences between accessing SQL Server databases and accessing Access databases. Once you understand the basics of data access you should be able to understand those differences. A good place to start is the topic "Walkthrough: Simple Data Access in a Windows Form." I know you said you don't have SQL Server, but in fact you do—sort of. The Microsoft Data Engine (MSDE) that ships with Visual Studio .NET is a stripped-down version of SQL Server that you can use to run the walkthroughs.



Once you've worked through that, take a look at "Unlocking Microsoft Access Data with ADO.NET" in the MSDN Library (http://msdn.microsoft.com/library). If you're interested in automating Access from .NET, you might also want to check out "HOW TO: Automate Microsoft Access from Visual Basic .NET (Q317113)" in the Knowledge Base. —Doctor D


Dear Doc Detective,

I need to deploy the .NET Framework with my application. According to the docs, there's a merge module for the framework that should do this. I can see the merge module in my deployment project, but it's excluded and when I try to include it I get a build error. Am I missing something? —Without a .NET

Dear Without, Okay, you caught us—the docs are incorrect. In reality, you can't deploy the .NET Framework with your .NET application, because the framework has to already be there in order for the installer to work properly. Fortunately there are other ways to redistribute the framework. Check out the article entitled "Using Visual Studio .NET to Redistribute the .NET Framework" in the MSDN Library to see what your options are. For a good overview of deployment, check out the whitepaper "Deployment Changes in Visual Basic .NET," also in the MSDN Library. It's aimed at VB developers, but it's a great introduction no matter which language you choose. And by the way, the writer that was responsible for the incorrect docs was forced to write "to deploy is better than to receive" on the chalkboard 500 times.

—the Doc Detective


Dear Doc Detective, I am working on a Web application. In the old ASP days, I could use Session, Response, Request and similar objects in my page. I can't find any documentation on those objects for ASP.NET, though. I did find documentation on something that sounds similar—HttpSessionState, HttpResponse, etc. Are those the same thing?

—Web-footed Friend Dear Friend,

Turns out that this is a pretty common question. The short answer to your question is: sort of. All those intrinsic objects you know and love—Session, Request, Application and all their cousins and their sisters and their aunts are still available to you in ASP.NET as properties of the page or control you are working with. What's a little confusing is that the intrinsic objects are static instances of the corresponding Httpxxxx classes. In the documentation for the Httpxxxx classes, this is usually (alas, not always!) noted in the fine print, a.k.a., the Remarks section. For instance, in the Remarks section of the HttpRequest Class topic, it says "The methods and properties of the HttpRequest class are exposed through the Request property of the HttpApplication, HttpContext, Page and UserControl classes." It doesn't quite say "You can use members of the HttpRequest class via the page's Request property," but that's what it means. In fact, you don't ever use the Httpxxxx classes directly. They're public classes only so that their members are exposed via the intrinsic objects such as Request and Session. Here's a list of the intrinsic objects and the classes they map to:

Request: HttpRequest
Context: HttpContext
Server: HttpServerUtility
Application: HttpApplicationState
Session: HttpSessionState
Trace: TraceContext
If you want to know what you can do with the Session object, for example, look in the topic HttpSessionState Members.

Happy (intrinsic) Webbing, —The Doc

Doc's Doc Tip(s) of the Day
If you press F1 to get Help, the Help topic shows up in the IDE in a docked window. To make it easier to read Help while working, you can undock the window in various ways. One is to right-click the tab for the Help topic, and then choose Floating. You might also find it useful to open Help as a separate application. From the Start menu, choose Programs, Microsoft Visual Studio .NET, Microsoft Visual Studio .NET Documentation. (Make yourself a shortcut if you do this often.) That way, you can use ALT+TAB to switch between the IDE and Help. Do you avoid Dynamic Help because you don't like what it shows? No problem—you can customize it. From the Tools menu, choose Options, Environment, Dynamic Help. There you can select the number and types of topics that appear. If you need information on your choices there, click Help!

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. URLs:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office12062001.asp http://support.microsoft.com/default.aspx?scid=kb;en-us;Q317113

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/vsredistdeploy.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchDistributingApplicationsCreatedWithVisualBasicNET.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebSessionStateHttpSessionStateMembersTopic.asp



   
The Doc Detective is a secret member of the .NET documentation team at Microsoft. Reach him at docdetec@microsoft.com.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date