Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > 'System.Data.DataRowView' does not contain a property ......

Reply
Thread Tools

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

 
 
=?Utf-8?B?ZXRyb3BpYw==?=
Guest
Posts: n/a
 
      05-09-2004
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 !!
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      05-09-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 !!



 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZXRyb3BpYw==?=
Guest
Posts: n/a
 
      05-10-2004
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 !
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'System.Data.DataRowView' does not contain a property with the name 'ID'. Monty ASP .Net 9 07-26-2011 11:57 AM
Does string contain A, and if so, does a section of string contain B Jason Carlton Javascript 11 12-08-2009 06:07 PM
'System.Data.DataRowView' does not contain a property with the name 'Title'. when using itemTemplate in DetailsView control rote ASP .Net 4 02-29-2008 10:09 AM
DataBinding: 'System.Data.DataRowView' does not contain a property with the name John ASP .Net 3 06-07-2006 04:31 PM
DataBinding: 'System.Data.DataRowView' does not contain a property with the name ... Georg Mayer ASP .Net 2 06-22-2004 08:48 AM



Advertisments