Hi Omego2k,
I had tried that before and tried it again but had no luck with it.
I still get the error at the same line
Me.lstMPIN.DataBind()
DataBinding: 'System.String' does not contain a property with the name 'MPIN'.
Main Topics
Browse All TopicsI am getting the error below :
when trying to bind the listbox with the Arraylist.. on this line :
Me.lstMPIN.DataBind()
DataBinding: 'System.String' does not contain a property with the name 'MPIN'.
The listbox is initially populated with the code below on page load
Me.SqlDataSourceUserList.C
Me.SqlDataSourceUserList.S
lstMPIN.DataSource = Me.SqlDataSourceUserList
lstMPIN.DataTextField = "MPIN"
And then later on I read the content of the listbox in a arraylist.. and need to repopulate the listbox with that arraylist .. the reason I am doing is I need to use the sort feature of the array..
Dim alItems_MPIN As New ArrayList()
For Each lst As ListItem In Me.lstMPIN.Items
alItems_MPIN.Add(lst.Text)
Next
alItems_MPIN.Sort()
lstMPIN.DataSource = ""
Me.lstMPIN.DataSource = alItems_MPIN
Me.lstMPIN.DataTextField = "MPIN"
Me.lstMPIN.DataBind()
any help Please ?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
No , i rechecked and its still the same issue.. If i remove my first set of code that populates the listbox on page load initially and instead of that I hardcode the values : then the arraylist code works without any issue.
The listbox is initially populated with the code below on page load
Me.SqlDataSourceUserList.C
Me.SqlDataSourceUserList.S
lstMPIN.DataSource = Me.SqlDataSourceUserList
lstMPIN.DataTextField = "MPIN"
lstMPIN.DataValueField = "MPIN"
lstMPIN.DataBind()
_________________________
here is what i am trying to do :
the listbox is initially populated with this code here on page load.
Me.SqlDataSourceUserList.C
Me.SqlDataSourceUserList.S
lstMPIN.DataSource = Me.SqlDataSourceUserList
lstMPIN.DataTextField = "MPIN"
lstMPIN.DataValueField = "MPIN"
lstMPIN.DataBind()
2) The value on the list box can change based on user selection: so I am reading all the available value in the listbox into Arraylist.. sorting it and putting it back in the Listbox. that is binding the arraylist back to Listbox.
I am getting the error while trying to bind it to the listbox.
__________
Now based on my trial , what i found was that If i dont do the first part ..populate the listbox with the way I am doing on page load . ..if for test purpose i just hardcode some value and try.. the second set of code of binding the arraylist works just fine.
any suggestion ?
Business Accounts
Answer for Membership
by: Omego2KPosted on 2009-10-30 at 16:05:10ID: 25707336
instead of:
Me.lstMPIN.DataSource = alItems_MPIN
Me.lstMPIN.DataTextField = "MPIN"
Me.lstMPIN.DataBind()
use this:
Me.lstMPIN.DataSource = alItems_MPIN
Me.lstMPIN.DataBind()