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"

Then i used displaymember and valuemember as,

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

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.


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"