0

Hi,

I am working on vb.net.When i try to bind data got from function to dropdownlist, its getting compiled successfully.But, iam unable to view the data.

CbxDisplayProject.DataSource = NewAdmin.getAllProjects()
CbxDisplayProject.DataTextField = "skillname"
CbxDisplayProject.DataValueField = "skillname"
CbxDisplayProject.DataBind()

Then i used displaymember and valuemember as,

CbxDisplaySkills.DataSource = NewAdmin.getAllSkills()
CbxDisplaySkills.DisplayMember = "skillname"
CbxDisplaySkills.ValueMember = "skillname"
CbxDisplaySkills.DataBind()

i am getting error as,
'DisplayMember' is not a member of 'System.Web.UI.WebControls.DropDownList'.
and 'ValueMember' is not a member of 'System.Web.UI.WebControls.DropDownList'.

Can someone help me in this regard?

4
Contributors
3
Replies
6
Views
7 Years
Discussion Span
Last Post by samacoba
0

The first part of the code you have written (DataTextField and ValueField) is a C# code and the other one seems to be of VB.NET. Why you are using both the codes??

Also ensure that NewAdmin.getAllSkills() returns a datatable which has "skillname" as one of its column. Probably u are not getting that value hence u r unable to see the ddl filled up with data.

Thanks.

0

Basically this is what they are saying(in Vb.Net if using C# tramslate accordingly).....
'The getallProjects should return a dataset with a table which has skillname as a column
CbxDisplaySkillslstModality.DataSource = NewAdmin.getAllProjects()
CbxDisplaySkills.DataTextField = "skillname"
CbxDisplaySkills.DataBind()

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.