S
Steven Blair
Query application made simple?
I have to use ASP.NET quite often to knock up quick protype
applications.
Generally, these applications have some components for querying and an
area of screen for displaying the results.
Using GridViews and SqlDataSource, I can almost make the application
with no code. My where clause is handled by the SqlDataSource.
What I would like to know is, can the SqlDataSource be made to be
"intelligent".
Following example shows what I need:
I add a SqlDataSource and DetailsView.
Add a TextBox and Button.
The Textbox value is added as a parameter to the SqlDataSource.
So, the program is run and I type in a value and hit the button, and it
brings me back the data.
But, how could I make the SqlDataSource "know" that the value might not
be used soemtimes.
If the Textbox is empty, I would want all the rows returned (not in a
DetailsView, but just in general)
If I leave the value empty, the select statement would look soemthing
like:
select * from myTable where colName =
The only way I can think of doing this is messy string manipulation.
What I want is a re-usbale approach.
Anyone got any ideas / techniques for this problem?
Steven
I have to use ASP.NET quite often to knock up quick protype
applications.
Generally, these applications have some components for querying and an
area of screen for displaying the results.
Using GridViews and SqlDataSource, I can almost make the application
with no code. My where clause is handled by the SqlDataSource.
What I would like to know is, can the SqlDataSource be made to be
"intelligent".
Following example shows what I need:
I add a SqlDataSource and DetailsView.
Add a TextBox and Button.
The Textbox value is added as a parameter to the SqlDataSource.
So, the program is run and I type in a value and hit the button, and it
brings me back the data.
But, how could I make the SqlDataSource "know" that the value might not
be used soemtimes.
If the Textbox is empty, I would want all the rows returned (not in a
DetailsView, but just in general)
If I leave the value empty, the select statement would look soemthing
like:
select * from myTable where colName =
The only way I can think of doing this is messy string manipulation.
What I want is a re-usbale approach.
Anyone got any ideas / techniques for this problem?
Steven