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?

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.

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()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.