Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Refreshing' SQLDataSource with new data
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346714
Message ID:
01346761
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I aksed this question here before, but I didn't get responses and I need to understand if what I'm thinking is possible in ASP.NET or not.
>
>In VFP Grids we're using "safe select" approach once we get new data. I'm thinking if something like this possible using SQLDataSource and GridView with DataSourceID set to SQLDataSource defined on the page.
>
>Once we created a new dataset that needs to be assigned to the GridView is there a way to "refresh" SQLDataSource (access its dataset) with the new data?
>
>That's my question and idea, anyone here knows if this can be done and how?
>
>Thanks again in advance.

Sorry, I can't directly answer your question. If you're already going to be taking some control over creating a dataset yourself (as opposed to using SQLDataSource (eg. modifying it's SelectCommand or something, then forcing it to requery), why not just go all the way and get rid of SQLDataSource altogether? Then you've got full control over how/when the GridView is bound. From the questions you've been asking about this it looks like you're sort of bumping into the limitations of the control anyway. FWIW - this is how I handle all of my web forms. I call out to a business object which is responsible for retrieving me a dataset, then I explicitly set it to bind to my grid. I have full control over when that happens, what data is included, how it gets filtered, etc.

However, you can have multiple SQLDataSource objects and swap the DataSourceID of the GridView between them. That should force it to refresh the grid with the new data.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform