first day in .NET so is going on?!?

Joined
Jan 22, 2003
Messages
22
Location
Indiana, USA
Ive bene trying to just get a DB connection and it wont work. Its an Access database so Im using the OleDbConnection. No where in any example does it have me reference this or anything. When I use examples as shown I get: "BC30002: Type OleDbConnection is not defined."

example:
Code:
Const sConnStr as String="Provider=Microsoft.Jet.OLEDB.4.0;" & _
  "Data Source=C:\Programming\Testing\Database.mdb;"
  
  Dim objConn as New OleDbConnection(sConnStr)
 
  objConn.Open()

So what is going on here? My head hurts after just trying to do a stupid connection opening...I fear for how long this will take me to get up to speed on it all.

Cheers!
 
The OleDbConnection class is in the System.Data.OleDb
namespace. To use the classes in this namespace, you need to
use the Imports statement to import this namespace into the
current code file.

This needs to go at the very top of your code file:
Code:
Imports System.Data.OleDb

If youre ever stuck looking for a classs namespace, launch the
Object Explorer and search for it.
 
Back
Top