|
-
Feb 16th, 2004, 09:06 AM
#1
Thread Starter
New Member
DataSet "Type Expected" Error
HELP!!!
I have some forms which I had programmed to use for database manipulations using OLE DB. These forms work perfectly! Now I tried to copy the code to a new similar form rather than re-coding all over and I keep getting a "Type Expected" error pointing to my dataset instantiation. Has anyone out there ever met this. If yes how did you solve it and most of all why does it occur?
Here is my code:
' Set up the connection string
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; DataSource=Students.mdb"
' Set up the connection
Dim Conn As New OleDbConnection(strConn)
' Set up the query
Dim sqlQuery As String = "SELECT * FROM Students"
' Set up the data adapter
Dim daStudents As New OleDbDataAdapter(sqlQuery, Conn)
' Set up the dataset
Dim dsStudents As New DataSet '<== This is the line where it gives the error
' Populate the dataset
daStudents.Fill(dsStudents, "Students")
Thanks
Orion
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|