Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling Dropdownlist box from WebService dataset help?

Status
Not open for further replies.

Ddraig

MIS
Jul 16, 2004
97
US
Howdy,

I've got a dataset that contains two tables. An ID and Name that is being passed through a xml web service that I would like to put into a dropdownlist box. I need to set a text value of the Name to display and the ID as the value member. I was wondering if anyone had any ideas, I've tried a few things that I can't seem to get to work. Was wondering if anyone knew of any good FAQs or sites that they would be willing to share with me.

I've also tried to add the data to a datagrid. I can't seem to pull in the data to the datagrid, but I can get the table descriptions. Anyone have a quick snip of code they could post as an example maybe that would help me with my problem above?

Thanks,
Dd.
 
show the code you use to fill the dataset and then use it.
 
I figured it out... :)

The Dataset I'm getting is froma Webservice, and it works but what my problem was is I needed to merge the dataset. Once I did that I managed to get it to show up. Here is what I have now.

'Fills Departments Dropdownlist
dsDepartments.Merge(wsHR1.GetDepartments)
ddlDepartment.DataSource = dsDepartments.Tables(0)
ddlDepartment.DataMember = "Departments"
ddlDepartment.DataTextField = "DeptDesc"
ddlDepartment.DataValueField = "DeptId"
ddlDepartment.DataBind()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top