Solved

C# Dropdown list in sql table?

Posted on 2010-11-23
6
555 Views
Last Modified: 2012-05-10
The C# web application has to pull a couple of drop down list in a form that will be cascade filter. For example depending on selection 1 in the dropdown list 1 the drop down list 2 will be populated.

What is the best way to populate the 2 dropdownlists. in the form. Not sure if i have the data in teh table form in sql tables.
0
Comment
Question by:XPLR
  • 4
  • 2
6 Comments
 
LVL 13

Expert Comment

by:iHadi
ID: 34200528
I suggest you do it using ajax. You can use the ajax Control Toolkit to do so:

http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/CascadingDropDown/CascadingDropDown.aspx

or any other Ajax library like jQuery
0
 

Author Comment

by:XPLR
ID: 34206041
The example is exactly what i needed but it uses webservices and i was hoping to do with something easier..
0
 
LVL 13

Accepted Solution

by:
iHadi earned 500 total points
ID: 34208032
Webservices are very easy to build and use. They are even easier than web pages to build. They do not need to be in a separate project. You can add a webservice asmx file as easily as adding an aspx file.

After you add it, all you need is to write your method in it and decorate it with the some attributes. That's it.

If you need help with that, just post here.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:XPLR
ID: 34345838
Can you give me an example of webservice method? I know how to create a webservice add file.
Also should you still use sql datasource or object data source?
0
 

Author Comment

by:XPLR
ID: 34346800
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Walkthrough/CCDWithDB.aspx -This example is complicated and i am new to .net/ajax coding. Also we are using a third party (telerik) for cascading drop down control. I'de appreciate if you can give a simple example
0
 

Author Closing Comment

by:XPLR
ID: 35796799
Looks like a complex solution
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
I have a large data set and a SSIS package. How can I load this file in multi threading?
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question