Dataset - what!!

Discussion in 'ASP .Net' started by Jim Bunton, Jun 12, 2009.

  1. Jim Bunton

    Jim Bunton Guest

    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
     
    Jim Bunton, Jun 12, 2009
    #1
    1. Advertising

  2. Jim Bunton

    sloan Guest

    Imports System.Data
    ?


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


    "Jim Bunton" <> wrote in message news:4a326de5$0$455$...
    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
     
    sloan, Jun 12, 2009
    #2
    1. Advertising

  3. Jim Bunton

    sloan Guest

    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.





    "sloan" <> wrote in message news:%...
    Imports System.Data
    ?


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


    "Jim Bunton" <> wrote in message news:4a326de5$0$455$...
    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
     
    sloan, Jun 12, 2009
    #3
  4. "Jim Bunton" <> wrote in
    news:4a326de5$0$455$:

    > 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



    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
     
    Gregory A. Beamer, Jun 15, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    1,838
    Chris Taylor
    Oct 31, 2003
  2. JimO

    DataSet and dataSet

    JimO, Mar 1, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    555
    Mary Chipman [MSFT]
    Mar 8, 2006
  3. Joseph D. DeJohn

    DataSet to DataSet

    Joseph D. DeJohn, Aug 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    424
  4. Nedu N
    Replies:
    2
    Views:
    2,207
  5. William Gower
    Replies:
    2
    Views:
    4,193
    Brian Baker [MVP]
    Jul 26, 2004
Loading...

Share This Page