Hi,

I'm trying to write a class for a dataadapter that I have to use numerous times in my application.

I did it the following way:

Imports System
Imports System.Data
Imports System.Data.OleDb

Public Class ClassMainGroup

Dim connectionDatabase As OleDbConnection = New OleDbConnection("Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDBatabase L" & _
"ocking Mode=1;Data Source=""C:\softlist\Softlist_database.mdb"";Jet OLEDB:Engine T" & _
"ype=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SF" & _
"P=False;persist security info=False;Extended Properties=;Mode=Share Deny None;Je" & _
"t OLEDB:Encrypt Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:" & _
"Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=Fals" & _
"e;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1")
Dim oledbdataadapterMainGroup As OleDbDataAdapter = New OleDbDataAdapter
Dim oledbselectcommandMainGroup As OleDbCommand = New OleDbCommand

oledbselectcommandMainGroup.commandtext = "SELECT CategoryID FROM categories"

End Class


I didn't even try to compile it because I know it won't work. The problem is the following: I defined oledbselectcommandMainGroup as an oledbcommand but when I try to give a commandtext to it, the codehelp says: declaration expected. I don't understand this because I defined it???

Can anybody help me or give me a link to a good tutorial on OO programming in VB.NET?


Thanx

Tom