Dataset - what!!

J

Jim Bunton

Visual Web Developer 2008

I am attempting to write the code to retrieve - within that code - data from an access database which I may then manipulate within the code.

having got thus far in some code
Imports System.Data.OleDb

Partial Class _Default

Inherits System.Web.UI.Page

.. . . . . . .

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Solutionsnet\RegularGuests\May2009\Web.mdb;User Id=admin;Password=;")

Dim da As New OleDbDataAdapter("SELECT * FROM Feedback WHERE Companyid = 10366", cn)

Dim dt As New OleDbConnection

I get into problems with all the examples I have found in websearches. They then want variously to dim and create new DataSets (or Datatables).

ANY reference I use for DataSets (or DataTables) gives errors

EG DIM ds as Dataset

Starts to give errors (and dataset or datatable aren't available in the intellisense tool!)



I guess I'm missing something simple BUT important here -

HELP!!
 
S

sloan

Imports System.Data
?


Looks like you may have just tacked on .OleDb to an existing line instead of adding a new one.


Visual Web Developer 2008

I am attempting to write the code to retrieve - within that code - data from an access database which I may then manipulate within the code.

having got thus far in some code
Imports System.Data.OleDb

Partial Class _Default

Inherits System.Web.UI.Page

. . . . . . .

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Solutionsnet\RegularGuests\May2009\Web.mdb;User Id=admin;Password=;")

Dim da As New OleDbDataAdapter("SELECT * FROM Feedback WHERE Companyid = 10366", cn)

Dim dt As New OleDbConnection

I get into problems with all the examples I have found in websearches. They then want variously to dim and create new DataSets (or Datatables).

ANY reference I use for DataSets (or DataTables) gives errors

EG DIM ds as Dataset

Starts to give errors (and dataset or datatable aren't available in the intellisense tool!)



I guess I'm missing something simple BUT important here -

HELP!!





--
Jim Bunton
 
S

sloan

when in doubt:

http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx



DataSet Class
Represents an in-memory cache of data.

Namespace: System.Data <<
Assembly: System.Data (in System.Data.dll)



See the "Namespace:". And see the "Assembly".

Make sure you have the reference to the assembly. Make sure you have the "using" ("imports" in VB.NET) statement(s) at the top of your .cs (.vb) file.





Imports System.Data
?


Looks like you may have just tacked on .OleDb to an existing line instead of adding a new one.


Visual Web Developer 2008

I am attempting to write the code to retrieve - within that code - data from an access database which I may then manipulate within the code.

having got thus far in some code
Imports System.Data.OleDb

Partial Class _Default

Inherits System.Web.UI.Page

. . . . . . .

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Solutionsnet\RegularGuests\May2009\Web.mdb;User Id=admin;Password=;")

Dim da As New OleDbDataAdapter("SELECT * FROM Feedback WHERE Companyid = 10366", cn)

Dim dt As New OleDbConnection

I get into problems with all the examples I have found in websearches. They then want variously to dim and create new DataSets (or Datatables).

ANY reference I use for DataSets (or DataTables) gives errors

EG DIM ds as Dataset

Starts to give errors (and dataset or datatable aren't available in the intellisense tool!)



I guess I'm missing something simple BUT important here -

HELP!!





--
Jim Bunton
 
G

Gregory A. Beamer

SNIPPED ...

EG DIM ds as Dataset

Starts to give errors (and dataset or datatable aren't available in
the intellisense tool!)



I guess I'm missing something simple BUT important here -

HELP!!

In addition to importing System.Data.OleDb, you need to import System.Data,
as the DataSet itself is there. Depending on where the DataSet is
physically located in your tree, you may have an import statement for the
dataset as well
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top