Click here to Skip to main content
16,019,263 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi, I have created one table "Product Master" which contains 'Name' and 'code'.
that table contains 25 name..My question is, how to create webservice and in that webservice take dropdownlist and how to bind all these 25 name to dropdownlist?

Please help me.

Thanks in advance.
Posted
Updated 13-Feb-13 8:55am
v3
Comments
Karthik Harve 13-Feb-13 3:36am    
your question is not clear. why do you need dropdownlist in webservice ? how you are trying to invoke that service ? do you need those names for dropdownlist from web service ? improve your question.
Sergey Alexandrovich Kryukov 13-Feb-13 15:10pm    
I don't think you understand what a Web service is. The question is invalid.
—SA
ZurdoDev 13-Feb-13 15:42pm    
It's very valid. People do it all the time. See my comment.
Sergey Alexandrovich Kryukov 13-Feb-13 15:45pm    
Data to be bound with a drop-down list is not a drop-down list, is it?
—SA
ZurdoDev 13-Feb-13 15:41pm    
There are lots of examples, likely, online, maybe even articles in here, where devs have used a webservice to return json data and bind that to a dropdown list.

1 solution

HTML
1. Create a WebService
   a. Get the data from your database
   b. return the data as DataTable
2. Create a method in your code file
   a. Get the DataTable returned by your above WebService
   b. Bind DropDownList to the DataTable
You are done... Good Luck...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900