Hello,
Thank you for both of you (Bill and Wen Yuan).
If I understand correctly Wen Yuan, you said I could retrieve multiple
records with one SqlDataSourec called. I never done with SqlDataSourece with
multiples recordset return before. Could you give me any samples? I did with
using SqlDataAdapter to return as many as 8 records at one time. In my case,
the one dropdown will retrieve data depend on the value from other dropdown
how it works with one retrieve. The way I have done now that I used
SqlDataAdapter to reteieve all records and saved them to ViewState and then
use DataTable to filter rows which I need for other dropdown.
Do you have any website or article (with samples) about SqlDataSource?
Thanks for your help.
WenYuan Wang [MSFT] - 08 Nov 2007 10:10 GMT
Hello Madison,
Thanks for your reply.
I'm sorry, maybe I mislead you. DataSource control only supports one record
set. We cannot retrieve multiple record sets with it.
What I mean is that I prefer Coding to DataSource Control. As Bill said,
using one SQLCommand call to retrieve all record sets from underlying
database is a good way. (Just as what you did) We can store the dataset
returned by SQLDataAdapter into Page.ViewState. When postback happens, we
get all records from ViewState, filter it by DataTableView, and bind them
to drop list box. That's fine.
However, if we choose SQLDataSource, it will save us much time on coding.
We can just drag-drop five SqlDataSource controls into page, set select
command/ parameter for each of them, and bind them to dropdownlist
controls. But there will be a performance issue. SqlDataSource will call
underlying DB, each time its parameter changed. For example: if end user
selects another option in (sector) dropdownlist, this will force two
sqldatasource controls (business type and building type) to call its
underlying DB. Thus, customer need wait a long time for this operation.
If you'd like to see some sample with SqlDataSource, you may refer to
http://www.asp.net/learn/data-access/tutorial-47-vb.aspx
Hope this helps, please feel free to update here again, if there is
anything unclear. It's my pleasure to assist you.
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
WenYuan Wang [MSFT] - 12 Nov 2007 11:41 GMT
Hello Madison,
This is Wen Yuan, again. I just want to check if there is anything we can
help with.
Please feel free to update here, if you have any more concern. We are glad
to assist you.
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.