Web Matrix with MS Access
page 1 of 1
Published: 06 Oct 2003
Unedited - Community Contributed
Abstract
We found that SQL and MSDE was displayed and connected easily in the WebMatrix interface, but... How can we connect to a MS Access Database? Is it MS Access not support in Web Matrix? This handy tool would perfectly work with a handy database file! Actually, connecting to MS Access in Web Matrix is definitly possible but require a "bit" of coding, and the key point of connecting to a MS Access Database comparing with SQL / MSDE database is ... the *Namespace*
by Colt Kwong
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 34450/ 50

Web Matrix with MS Access

One of our major use of ASP.NET Web Application is to build a Database Driven Application. In the current version of Web Matrix, 2 types of database can be connected and used easily: Microsoft SQL Server and Microsoft Desktop Engine (MSDE).

In the Guided Tour of Web Matrix, we can know that connect, retrieve, display and/or modify data with either of the database above are EXTREMELY easy and convenient.

E.g. If we want to select data and display on screen, we can do a few steps:

Open Web Matrix -> select Data window and tab -> Connect to a Database -> Expand the Table node -> Drag & Drog a Table onto the WebForm -> Drag & Drog the required code from Code Builder...

Yes, connecting to SQL/MSDE is very easy, just a few of simple steps. Well.. I don't want to say too much about this in this article, as it would probably be covered in the
Guided Tour of Web Matrix

We found that SQL and MSDE was displayed and connected easily in the WebMatrix interface, but... How can we connect to a MS Access Database? Is it MS Access not support in Web Matrix? This handy tool would perfectly work with a handy database file!

Actually, connecting to MS Access in Web Matrix is definitly possible but require a "bit" of coding, and the key point of connecting to a MS Access Database with SQL / MSDE database is the Namespace. We have to use System.Data.OleDb Namespace if we're going to connect to a MS Access Database. So, the following directive have to declare in a Web Form at first:

<%@ Import Namespace="System.Data.OleDb" %>

Ok, let's take a look at a sample and code about how to connect, retrieve and display data from a MS Access Database to a DataGrid, that's just like and as simple as connecting to a SQL Server / MSDE Database!

Demo        Download



User Comments

Title: how to insert data in to a ms access database   
Name: Ravi Tiwari
Date: 4/8/2007 9:42:18 AM
Comment:
i wanted to knw, how to insert data in to MSAccess database from ASP.NET web forms ? because data retrieving is possible with data grid. but i have the problem while inserting. can u give step by step coding for this ?
Title: Web Matrix with MS Access   
Name: Kush
Date: 10/12/2005 1:37:36 PM
Comment:
I must thank you first. However, i wanted to knw, how to insert data in to MSAccess database from ASP.NET web forms ? because data retrieving is possible with data grid. but i have the problem while inserting. can u give step by step coding for this ?
Title: ref Editing access database   
Name: Richard
Date: 9/2/2005 10:46:58 AM
Comment:
Colt, thanks for the information.
Title: RE: Editing access database   
Name: Colt
Date: 8/26/2005 10:20:43 AM
Comment:
Hi Richard,

You can find more articles about SQL from AspNet101.com,
for example: http://www.aspnet101.com/aspnet101/tutorials.aspx?id=17

Colt Kwong
Title: Editing access database   
Name: Richard
Date: 8/26/2005 9:53:37 AM
Comment:
I enjoy your pointers, I am able to display tables in my web page using access however I am seeing a lot of tutorials and code example to do more queries in SQL of MSDE. Do you have any tutorials showing how to edit and update access database using web matrix
Title: re:   
Name: spam filter
Date: 2/22/2005 10:52:41 AM
Comment:
thank you for this artivle. it helps me....
Title: Web Matrix with MS Access   
Name: Les
Date: 10/18/2004 5:04:51 AM
Comment:
I have an even easier way of connecting web matrix to MS Access without any coding. Simply install beta of Visual Web Developer Express 2005. Web matrix will then display MS Access as an available database connection along with SQL/MSDE. Everything then works just fine with Access. And if you then uninstall WD Express it continues to work.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2014 ASPAlliance.com  |  Page Processed at 4/25/2014 2:18:41 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search