469,616 Members | 1,792 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,616 developers. It's quick & easy.

SqlDataSource and multiple recordsets

Hi all,

Could I use the sqldatasource with stored-procedure to return multiple
recordset? I did not want to have any sqldatasourec in the one page just to
return the record back to dropdownlists. In my stored procedure will have 2
select statement. If it can be done how I refer to each dropdownlist to
correct recordset. Please advise. Thanks.
Jul 24 '07 #1
4 5949
The SqlDataSource is a piece of software that wraps all functionality in one
convenient wrapper. Underneath the hood it contains all of the plumbing to
make simple drag and drop and configure a reality. In .NET, you use multiple
SqlDataSource controls to complete multiple steps. You might be able to
kludge this, but I am not sure it is worth it. If you want to go this route,
you can try concatenating multiple SQL statements, but I am not sure how you
would separate out the many tables. But, I have not dug deeply into the
SqlDataSource.

If you need to step outside of this box, you should learn about the
underlying objects and code you own data access.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Madison" <Ma*****@discussions.microsoft.comwrote in message
news:30**********************************@microsof t.com...
Hi all,

Could I use the sqldatasource with stored-procedure to return multiple
recordset? I did not want to have any sqldatasourec in the one page just
to
return the record back to dropdownlists. In my stored procedure will have
2
select statement. If it can be done how I refer to each dropdownlist to
correct recordset. Please advise. Thanks.

Jul 24 '07 #2
From what I've read the SqlDataSource works with 1 table only. A
dataset can be filled with multiple tables from your stored procedure,
though.

From here http://forums.asp.net/t/1021356.aspx:

"I think everybody is half-correct here.

If you want a SqlDataSource, you would need one for each table. Not
sure why that is a big deal.

But you *can* issue multiple unrelated selects in a single stored proc
and load them into a DataSet and reference them by table."

Madison wrote:
Hi all,

Could I use the sqldatasource with stored-procedure to return multiple
recordset? I did not want to have any sqldatasourec in the one page just to
return the record back to dropdownlists. In my stored procedure will have 2
select statement. If it can be done how I refer to each dropdownlist to
correct recordset. Please advise. Thanks.
Jul 24 '07 #3
Thanks for your quick reply.

I have been using dataset to do most of it. Do you think with multiple
SqlDataSource call it will ok? Because I read about how to handle the
connection most the time they recommanded not to do that. I will end up to
have about 5-6 trips to fill the dropdowlist.

"Cowboy (Gregory A. Beamer)" wrote:
The SqlDataSource is a piece of software that wraps all functionality in one
convenient wrapper. Underneath the hood it contains all of the plumbing to
make simple drag and drop and configure a reality. In .NET, you use multiple
SqlDataSource controls to complete multiple steps. You might be able to
kludge this, but I am not sure it is worth it. If you want to go this route,
you can try concatenating multiple SQL statements, but I am not sure how you
would separate out the many tables. But, I have not dug deeply into the
SqlDataSource.

If you need to step outside of this box, you should learn about the
underlying objects and code you own data access.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Madison" <Ma*****@discussions.microsoft.comwrote in message
news:30**********************************@microsof t.com...
Hi all,

Could I use the sqldatasource with stored-procedure to return multiple
recordset? I did not want to have any sqldatasourec in the one page just
to
return the record back to dropdownlists. In my stored procedure will have
2
select statement. If it can be done how I refer to each dropdownlist to
correct recordset. Please advise. Thanks.


Jul 24 '07 #4
Sorry about the EW comment. I thought I was still in the Expression Web
group. The rest of the post applies.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Madison" <Ma*****@discussions.microsoft.comwrote in message
news:DA**********************************@microsof t.com...
Thanks for your quick reply.

I have been using dataset to do most of it. Do you think with multiple
SqlDataSource call it will ok? Because I read about how to handle the
connection most the time they recommanded not to do that. I will end up to
have about 5-6 trips to fill the dropdowlist.

"Cowboy (Gregory A. Beamer)" wrote:
>The SqlDataSource is a piece of software that wraps all functionality in
one
convenient wrapper. Underneath the hood it contains all of the plumbing
to
make simple drag and drop and configure a reality. In .NET, you use
multiple
SqlDataSource controls to complete multiple steps. You might be able to
kludge this, but I am not sure it is worth it. If you want to go this
route,
you can try concatenating multiple SQL statements, but I am not sure how
you
would separate out the many tables. But, I have not dug deeply into the
SqlDataSource.

If you need to step outside of this box, you should learn about the
underlying objects and code you own data access.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

*********************************************** *
Think outside the box!
*********************************************** *
"Madison" <Ma*****@discussions.microsoft.comwrote in message
news:30**********************************@microso ft.com...
Hi all,

Could I use the sqldatasource with stored-procedure to return multiple
recordset? I did not want to have any sqldatasourec in the one page
just
to
return the record back to dropdownlists. In my stored procedure will
have
2
select statement. If it can be done how I refer to each dropdownlist to
correct recordset. Please advise. Thanks.



Jul 24 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jason Shohet | last post: by
16 posts views Thread by Randy Harris | last post: by
4 posts views Thread by msch-prv | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.