Assume I have a page with a data grid bound to a data source. If I have 2 different clients accessing this page, is the data source different for each of them, or do they use the same data source?
-
If they’re the same, what happens if a client applies a filter? The other clients sees that filter too? How to avoid this?
-
If they’re not the same, and I have a big number of records, and data source mode is to DataSet, would this store 2 copies of same data on server? How do I solve such problems?
The SqlDataSource control is an instance class, so it would be recreated on each request. You may want to look into connection pooling though, so you can reuse database connections.
I don’t think it’s possible to make the control static, and I don’t think you need to make the control static. If you want to reuse the dataset for all users who visit the page, I would look into caching the DataSet, or storing it in application state. I believe you can do this with the SqlDataSource using a mixture of the OnSelecting and OnSelected events.