VS2005 - How to connect to a TableAdapter in the data layer

Discussion in 'ASP .Net' started by dbuchanan, Dec 1, 2005.

  1. dbuchanan

    dbuchanan Guest

    Here are pertinent parts of my solution structure
    \\
    Solution 'QMS_01
    -QmsDataLayer
    ---My Project
    ---app.config
    ---DataSet1.xsd
    -QmsUI
    ---My Project
    ------DataSources (folder)
    ---------QmsDataLayer.DataSet1+lkpDeviceTypeDataTable.datasource
    ---References
    ------QmsDataLayer
    ---Form1
    //

    In the DataSet of the QmsDataLayer is a DataTable (lkpDeviceType) that
    has its "LkpDeviceTypeTableAdapter" configured for the stored
    procedures in SQL Server 2000 for Fill and GetData.

    On "Form1" in the user interface layer (QmsUI) is a DataGridView whose
    source is "lkpDeviceTypeTableAdapterBindingSource"

    In Form1 component tray I have
    \\
    lkpDeviceTypeTableAdapterBindingSource
    DataSet11
    LkpDeviceTypeTableAdapter1
    //

    This code is not accepted
    \\
    LkpDeviceTypeTableAdapter.Fill
    //

    What am I missing?

    dbuchanan
    dbuchanan, Dec 1, 2005
    #1
    1. Advertising

  2. dbuchanan

    dbuchanan Guest

    I Got a little further...

    After playing around a bit with the data layer, the references and also
    reviewing other code I was able to enter the following code;

    \\
    Me.LkpDeviceTypeTableAdapter1.Fill(Me.DataSet11.lkpDeviceTypeDataTable)
    //

    But it does not accept the last part...
    (Me.DataSet11.lkpDeviceTypeDataTable)
    There is the squiggle under it an the error says

    "'lkpDeviceTypeDataTable' is a type in 'QmsDataLayer.DataSet1' and
    cannot be used as an expression"

    What do I do next?

    dbuchanan
    dbuchanan, Dec 1, 2005
    #2
    1. Advertising

  3. dbuchanan

    Bart Mermuys Guest

    Hi,

    "dbuchanan" <> wrote in message
    news:...
    >I Got a little further...
    >
    > After playing around a bit with the data layer, the references and also
    > reviewing other code I was able to enter the following code;
    >
    > \\
    > Me.LkpDeviceTypeTableAdapter1.Fill(Me.DataSet11.lkpDeviceTypeDataTable)


    It shouldn't end with 'DataTable' otherwise it's a typed DataTable _class_,
    what you need is a property on the Typed DataSet that returns an _instance_
    ..

    Try:
    Me.LkpDeviceTypeTableAdapter1.Fill(Me.DataSet11.lkpDeviceType)

    Note that when you have made a Data Source ( Menu->Data->Show Data Sources /
    Add New Data Source ) you can drag one of the DataTable's to the Form and
    everything will be setup for you, you can always use it to look at the
    generated code to see how things should be done.


    HTH,
    Geetings



    > //
    >
    > But it does not accept the last part...
    > (Me.DataSet11.lkpDeviceTypeDataTable)
    > There is the squiggle under it an the error says
    >
    > "'lkpDeviceTypeDataTable' is a type in 'QmsDataLayer.DataSet1' and
    > cannot be used as an expression"
    >
    > What do I do next?
    >
    > dbuchanan
    >
    Bart Mermuys, Dec 1, 2005
    #3
  4. dbuchanan

    dbuchanan Guest

    Thank you
    dbuchanan, Dec 1, 2005
    #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. dbuchanan
    Replies:
    0
    Views:
    430
    dbuchanan
    Dec 12, 2005
  2. dbuchanan
    Replies:
    0
    Views:
    4,668
    dbuchanan
    Dec 13, 2005
  3. et
    Replies:
    2
    Views:
    1,911
  4. Wolfgang
    Replies:
    1
    Views:
    1,106
  5. Dhananjay
    Replies:
    1
    Views:
    1,111
    sloan
    Dec 18, 2006
Loading...

Share This Page