ASP.NET & Databases Part 1
page 2 of 7
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 33666/ 87

Connection


Connection
 

To connect to a database, you now use the OleDbConnection like this -

Dim objConn as New OleDBConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=e:\sff\site\db\users.mdb")

As you can see it takes the connection string as a parameter, this is quite simple. Of course, you then have to open it with the open() method.

objConn.Open()

That is all.
In case you're wondering, you use the Close method to close it.



View Entire Article

User Comments

Title: Re: One comment   
Name: Philip Q
Date: 2004-10-25 11:08:14 PM
Comment:
Jen,

The reason for that is that you have imported System.Data, but not System.Data.OleDb into your page.
Title: One comment.   
Name: Jen
Date: 2004-10-25 9:33:47 AM
Comment:
Putting the OleDBConnection command into the page_load event gives the error that OleDBConnection is not defined. However, OleDb.OleDbConnection works.
Title: Good...how to work with more than one dataset   
Name: Santhosh Kumar A.
Date: 2004-10-19 6:41:29 AM
Comment:
I found it very good. Please try to include how
to manipulate rows using For Each ... Next loop.
I was really searching for it.

Santhosh Kumar A.
Kerala, India

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-12-02 8:56:12 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search