Ask the Doc Detective

Ask the Doc Detective

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 ( 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 [email protected].


Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as