Array of datarows

B

Brian Henry

If I have an array of data rows, how do i bind a listbox to that array of
rows and show whats in a column? right now if i bind to the array it just
shows "System.Data.DataRow" as the name, but if i bind to a table with the
same rows it works.
 
M

Miha Markic [MVP C#]

Hi Brian,

I am not sure on this but I think you won't be able to achieve it.
Instead, use DataView as a datasource.
 
K

Kevin Yu [MSFT]

Thanks for Bill and Miha's quick response!

Hi Brian,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when binding to an array of DataRows,
the data on the ListBox cannot be shown correctly. If there is any
misunderstanding, please feel free to let me know.

I agree with Bill's suggestion. Based on my experience, this happens when
the DisplayMemeber or ValueMember property of that LisBox was not set
properly. So please check your code to see if these two properties have
been set.

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
B

Brian Henry

Thanks Kevin,

I have checked them and they are correct. For now I decided to take another
rout to do the same thing. It seems to be working fine with the changes I
decided to make. Thanks for all the help
 
K

Kevin Yu [MSFT]

Hi Brian,

It was nice to hear that you have had the problem resolved. Thanks for
sharing your experience with all the people here. If you have any
questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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

Top