'System.Data.DataRowView' does not contain a property ......

Discussion in 'ASP .Net' started by =?Utf-8?B?ZXRyb3BpYw==?=, May 9, 2004.

  1. I am trying to bind two tables to two different list boxes

    Ther tables are working as I use them on another page wth no problems

    The code is as follows...

    private void Page_Load(object sender, System.EventArgs e

    oleDbDataAdapter2.Fill( dataSet1)
    oleDbDataAdapter4.Fill( dataSet1)

    listVersion.DataSource = dataSet1
    listVersion.DataTextField = "version"
    listVersion.DataValueField = "version"
    listVersion.DataBind()

    listMerchant.DataSource = dataSet1
    listMerchant.DataTextField = "merchant"
    listMerchant.DataValueField = "merchant"
    listMerchant.DataBind()


    the merchant one works fine, the versions one returns..

    DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name version.

    both adapters are created the same way and work fine on another page (the versions table is working as expected). I don't think its a problem with the db. If I remove the listVersion.Bind(); it will compile and run loading only the merchants list of course..

    I know this is probably not enough info, but maybe other people have seen this and can point to the right direction

    thanks so much !!
     
    =?Utf-8?B?ZXRyb3BpYw==?=, May 9, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?ZXRyb3BpYw==?=

    Teemu Keiski Guest

    Hi,

    the data is in two separate tables in the DataSet. You need to distinguish
    the table to use when databinding. For example:

    listVersion.DataSource = dataSet1.Tables[0];
    ....
    listMerchant.DataSource = dataSet1.Tables[1];

    not sure which way it should be as I know nothing about your data/database.
    You can give tables a name when calling Fill method and access table with
    that name via DataSet's Tables property.

    oleDbDataAdapter2.Fill( dataSet1,"Table1");
    oleDbDataAdapter4.Fill( dataSet1,"Table2");

    and then respectively:

    listVersion.DataSource = dataSet1.Tables["Table1"];
    ....
    listMerchant.DataSource = dataSet1.Tables["Table2"];

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke


    "etropic" <> wrote in message
    news:...
    > I am trying to bind two tables to two different list boxes.
    >
    > Ther tables are working as I use them on another page wth no problems.
    >
    > The code is as follows....
    >
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > oleDbDataAdapter2.Fill( dataSet1);
    > oleDbDataAdapter4.Fill( dataSet1);
    >
    > listVersion.DataSource = dataSet1;
    > listVersion.DataTextField = "version";
    > listVersion.DataValueField = "version";
    > listVersion.DataBind();
    >
    > listMerchant.DataSource = dataSet1;
    > listMerchant.DataTextField = "merchant";
    > listMerchant.DataValueField = "merchant";
    > listMerchant.DataBind();
    > }
    >
    >
    > the merchant one works fine, the versions one returns...
    >
    > DataBinder.Eval: 'System.Data.DataRowView' does not contain a property

    with the name version.
    >
    > both adapters are created the same way and work fine on another page (the

    versions table is working as expected). I don't think its a problem with the
    db. If I remove the listVersion.Bind(); it will compile and run loading
    only the merchants list of course...
    >
    > I know this is probably not enough info, but maybe other people have seen

    this and can point to the right direction ?
    >
    > thanks so much !!
     
    Teemu Keiski, May 9, 2004
    #2
    1. Advertising

  3. great ! I will look into that

    I thought though that was only true with UNTyped dataSet, and I am using a Typed DataSet

    thanks again !
     
    =?Utf-8?B?ZXRyb3BpYw==?=, May 10, 2004
    #3
    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. Georg Mayer
    Replies:
    2
    Views:
    11,361
    Georg Mayer
    Jun 22, 2004
  2. John
    Replies:
    3
    Views:
    21,621
    Eliyahu Goldin
    Jun 7, 2006
  3. Monty
    Replies:
    9
    Views:
    22,403
    jyothsna
    Jul 26, 2011
  4. rote
    Replies:
    4
    Views:
    746
    Eliyahu Goldin
    Feb 29, 2008
  5. hon123456
    Replies:
    1
    Views:
    3,742
    Coskun Sunali [MVP]
    Jul 27, 2009
Loading...

Share This Page