G
Greg Ramsey
Hi - I'm a real newbie to ASP . . so please forgive me. . . and please point
me in the right direction for how to do this "the right way" . .
Using Northwind DB as an example, I have a gridview bound to a
sqldatasource, with a SelectQuery = SELECT [ProductName], [QuantityPerUnit],
[UnitPrice], [UnitsInStock] FROM [Alphabetical list of products]
That all works fine. . . but what I want to do next is this: Users clicks on
button "Customers and Suppliers By City", and the code for the button simply
sets SelectCommand = SELECT * FROM [Customer and Suppliers by city]
This obviously bombs when I click on the button, and it states that
"ProductName" as not found on the selected data source.
I hate to think of creating a separate gridview and datasource for each
Table I desire to display. . . Is there any way I can "reset" the gridview
so that it pulls the proper schema from the "updated" datasource before
rendering in the display? I've tried databind() for both sqldatasource and
gridview.
Any examples you could point me to would be greatly appreciated.
Greg
me in the right direction for how to do this "the right way" . .
Using Northwind DB as an example, I have a gridview bound to a
sqldatasource, with a SelectQuery = SELECT [ProductName], [QuantityPerUnit],
[UnitPrice], [UnitsInStock] FROM [Alphabetical list of products]
That all works fine. . . but what I want to do next is this: Users clicks on
button "Customers and Suppliers By City", and the code for the button simply
sets SelectCommand = SELECT * FROM [Customer and Suppliers by city]
This obviously bombs when I click on the button, and it states that
"ProductName" as not found on the selected data source.
I hate to think of creating a separate gridview and datasource for each
Table I desire to display. . . Is there any way I can "reset" the gridview
so that it pulls the proper schema from the "updated" datasource before
rendering in the display? I've tried databind() for both sqldatasource and
gridview.
Any examples you could point me to would be greatly appreciated.
Greg