473,566 Members | 3,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6123
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*****@discus sions.microsoft .comwrote in message
news:30******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .comwrote in message
news:30******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .comwrote in message
news:DA******** *************** ***********@mic rosoft.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
SqlDataSourc e 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
SqlDataSourc e.

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*****@discus sions.microsoft .comwrote in message
news:30******* *************** ************@mi crosoft.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
16495
by: (Pete Cresswell) | last post by:
I posted this in the MS Access group, but no luck. ------------------------------------------ I've got another stored procedure in the same app that returns multiple recordsets and the code works. But now I've written another SP and the code traps out with the 3251 message. The SP is writing two recordsets. When I run the SP in Query...
0
1210
by: Jason Shohet | last post by:
I'm using the new SqlDataSource with the beta. Below I have my code: asp:SqlDataSource ID="ds" Runat="server" SelectCommand="SELECT employee_ssno, firstname, lastname FROM employee_temp order by lastname" ConnectionString="<%$ ConnectionStrings:AppConnectionString1 %>" ProviderName="System.Data.OleDb" UpdateCommand="UPDATE...
12
17629
by: Scott | last post by:
Front-end Access 2000 I have a stored procedure that has 2 parameters BusinessUnitID and Year. It returns multiple record sets (5 to be exact). I thought I could use a Pass through query but that only returns the first record set. I thought I could use ADO but that does not seem to work. I get an Error
16
5709
by: Randy Harris | last post by:
I was inspired by the recent discussion of returning multiple recordsets to ADO from a stored procedure. (Amazed is probably more accurate). I asked about how to accomplish same with Oracle and got a nudge in the right direction from Mr. Kreft. I promised to provide details once working, so here it is. The code is shown below. My next...
0
2352
by: nachiket2k2 | last post by:
Hi, I am using VB 6.0, ADO 2.0 with MS Access 2000 Database. in a vb form, i need to fatch data from 3 different tables (ABC.MDB). it will be a tedious job if i create 3 connections with 3 recordsets. is it possible to do programming in such a way that we can use multiple recordsets with SAME connection? firing SQL statments one after the...
0
1783
by: Nam | last post by:
I want to use the same sqlDataSource for two CheckBoxList controls in ASP.NET 2.0. For simplicity, I am using the case of only two CheckBoxList controls in the following example: My sqlDataSource is bound to a table in my database. The table has four columns, say, col1_ID, col1_value and col2_ID, col2_value. The DataValueField and...
2
9884
by: Ned Balzer | last post by:
I'm trying to create a formview bound to a sqldatasource, and use a stored procedure to insert data from the formview into several tables. I have some simplified code below, the real code is much longer but this should illustrate the problem: <asp:FormView ID="bookFormView" runat="server" DataSourceID="bookSqlDataSource"> <ItemTemplate>...
4
2333
by: msch-prv | last post by:
I use an Access db in my application. So far I have been exclusively working wtih the AccessDataSource controls to hook up to the db. I know that Access db connections can also be established with SqlDataSource. What are the trade-offs between the AccessDataSource and SqlDataSource? Also, I am confused about the connection state. What...
0
1337
by: suganya | last post by:
Hi I have a GridView in my Page. I have to bind multiple tables into the GridView using SQLDataSource. For that I have given the coding as <asp:GridView ID="Search_GridView" runat="server" Style="z-index: 100; left: 2px; position: absolute; top: 270px" AutoGenerateColumns="False"...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.