troubleshooting Question

dynamically changing the datasource in codebehind file

Avatar of Arnold Layne
Arnold LayneFlag for United States of America asked on
ASP.NETC#Web Applications
5 Comments1 Solution218 ViewsLast Modified:
I am using asp.net and C#. I am familiar with gridviews and datasources. However, i cannot figure out a way, using these controls, to dynamically filter results in the code behind from the sqldatasourse I have set up.

So if the query string has user="all", i want it populate the data grid with all records. If user equals a certain name, it will only show records associated wit the user.

I thought about making multiple datasources and swapping them in and out based on what comes in from the query string, but it doesn't work. The table I am getting data from is simple. It has two columns, filename and user. I want the data grid to only show the filename field, and only show what is dictated by the user found in the query string.

Also, very important. I need to wrap every result line in a hyperlink, that will use the filename data to build the final part of the url of the link
ASKER CERTIFIED SOLUTION
Jerry Miller

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros