Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

SqlDataSource and multiple recordsets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Madison - 24 Jul 2007 14:38 GMT
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.
Cowboy (Gregory A. Beamer) - 24 Jul 2007 14:51 GMT
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.

Signature

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!
************************************************

> Hi all,
>
[quoted text clipped - 5 lines]
> select statement. If it can be done how I refer to each dropdownlist to
> correct recordset. Please advise. Thanks.
Madison - 24 Jul 2007 15:42 GMT
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.

> 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
[quoted text clipped - 17 lines]
> > select statement. If it can be done how I refer to each dropdownlist to
> > correct recordset. Please advise. Thanks.
Cowboy (Gregory A. Beamer) - 24 Jul 2007 17:33 GMT
It depends on how many users you will have on your site. If you are google,
then I would not recommend the multiple DataSource option. If a hobbiest or
small business site, it will get you to market quicker.

If it were me, I would use a tiered approach, but I focus more on Enterprise
level solutions. If you want to get a feel for this, there are some starter
apps from Microsoft or you can go the full monty with something like
www.dofactory.com 's Design Framework. It is relatively cheap for the amount
of code, samples and documentation and will give you a leg up on tiered
design.

I am not real fond of the DataSource controls, although I do see why they
are there. If you do go that route, consider goind AJAX, although EW will
not help as much as VWD in this respect. If you are cascading the dropdowns,
there is a nice way to do this with the AJAX controls, but you will need VWD
to complete the tasks. Check it out at http://ajax.asp.net and make sure you
look at the cascading dropdown video tutorial. You then feed the controls
based on what is updating. Pretty cool if you ask me. And, it reduces your
hits on subsequent AJAX calls, so it will reduce the "damage" from the
DataSource, if you go that route.

Signature

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!
************************************************

> Thanks for your quick reply.
>
[quoted text clipped - 31 lines]
>> > select statement. If it can be done how I refer to each dropdownlist to
>> > correct recordset. Please advise. Thanks.
Cowboy (Gregory A. Beamer) - 24 Jul 2007 17:34 GMT
Sorry about the EW comment. I thought I was still in the Expression Web
group. The rest of the post applies.

Signature

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!
************************************************

> Thanks for your quick reply.
>
[quoted text clipped - 31 lines]
>> > select statement. If it can be done how I refer to each dropdownlist to
>> > correct recordset. Please advise. Thanks.
Beowulf - 24 Jul 2007 14:53 GMT
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."

> Hi all,
>
[quoted text clipped - 3 lines]
> select statement. If it can be done how I refer to each dropdownlist to
> correct recordset. Please advise. Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.