473,767 Members | 2,198 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple select statements in a single stored procedure.

I have coded multiple select statements in a single stored procedure, and
when I execute this procedure on SQL Server Management Express, I correctly
get multiple result sets. But, if I try to add a new Data Source to to my VB
2005 project, and point to this stored procedure, the data source wizard only
sees the 'first' select statement. Is there a way to load multiple tables in
a DataSet from a single stored procedure with multiple select statements?
TIA,
--
Terry
Jul 6 '07 #1
2 5095
Terry,

The first already gives your answer

http://groups.google.com/group/micro...8d87927915d6fe

Cor

"Terry" <Te***@nospam.n ospamschreef in bericht
news:33******** *************** ***********@mic rosoft.com...
>I have coded multiple select statements in a single stored procedure, and
when I execute this procedure on SQL Server Management Express, I
correctly
get multiple result sets. But, if I try to add a new Data Source to to my
VB
2005 project, and point to this stored procedure, the data source wizard
only
sees the 'first' select statement. Is there a way to load multiple tables
in
a DataSet from a single stored procedure with multiple select statements?
TIA,
--
Terry

Jul 6 '07 #2
Hi Cor,
Thank you for yopur responce, but, the link you sent me to is in fact
wrong! At least as far as VS2005 is concerned. Under VS2003, when you drag
a stored procedure on the the form and generate a dataset, you get a table
for each select statement. Under VS2005 you only get a table for the first
select statement. Is this change in behavior intentional? If so, I wonder
why. It sounds like a bug to me.
--
Terry
"Cor Ligthert [MVP]" wrote:
Terry,

The first already gives your answer

http://groups.google.com/group/micro...8d87927915d6fe

Cor

"Terry" <Te***@nospam.n ospamschreef in bericht
news:33******** *************** ***********@mic rosoft.com...
I have coded multiple select statements in a single stored procedure, and
when I execute this procedure on SQL Server Management Express, I
correctly
get multiple result sets. But, if I try to add a new Data Source to to my
VB
2005 project, and point to this stored procedure, the data source wizard
only
sees the 'first' select statement. Is there a way to load multiple tables
in
a DataSet from a single stored procedure with multiple select statements?
TIA,
--
Terry


Jul 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6413
by: Richard Adams | last post by:
Is it possible to execute more than one statement in SQL via MDAC ODBC? I have a fairly complex select I wanted to create a view with, but trying to send it all as one string with terminators ';' between doesn't work (invalid character.) How can I do this kind of thing from VB.NET? Thanks in advance Richard
5
6916
by: Lauren Quantrell | last post by:
Just wondering if this is good form: Alter Procedure "mySPName" @UniqueID int AS set nocount on set xact_abort off DELETE FROM tblNameOne
1
2617
by: Top Gun | last post by:
In order to avoid multiple trips to the database, I would like to fill several tables in a DataSet with a single call to a stored procedure that will return resultsets for the appropriate tables. Can the SqlDataReader be used for this?
1
11583
by: Ahmet Karaca | last post by:
Hi. myds.Reset(); mycommand.SelectCommand.CommandText= "Select att1 from Ing as Ingredient, Pro as Product "+ "where Pro.ad='apple' and Pro.id=Ing.id"; mycommand.Fill(myds, "Product"); // Here is the problem listbox.DataSource = myds.Tables.DefaultView; // Here again listbox.DataTextField = "invid"; // Here again listbox.DataBind(); mycon.Close()
7
3002
by: Matt Jensen | last post by:
Howdy Fairly simple question I think, I presume the answer is no it can't be reused for 2 *SELECT* statements, but just hoping for clarification. Just asking in the interests of trying to minimise code. i.e. if the SqlDataAdapter uses a connection to the one database for a select statement and I want to do a second select statement on exactly the same database, can I reuse the SqlDataAdapter? I ask because I want to put both 'select'...
1
7283
by: syntego | last post by:
I am using DB2 V8 fixpack 10 and have the following issue: >From a User Defined Function, I can assign multiple variables in a single statement as follows: -- Get the first update transaction for the mailing event. set (fUpdateTS, fAddrType, fAccountID, fOpCode) = (select AddTS, UpdateTypeCode, AccountID, OpCode FROM
5
12262
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected to the database. SQLSTATE=57030. Background: I created a linked server to DB2 8.1 database which called GRR_DB2Server. In my stored procedure p_FetchRawData, I need to read some data from this linked server GRR_DB2Server and insert them into
7
20331
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables, if they do not already exist. In terms of ASP/ADO, that would be fine in a SQL Server Sense by a simply ASP/Server-Side JavaScript as such: var cnTemp = Server.CreateObject("ADODB.Connection");
4
6940
by: vertigo262 | last post by:
Is it possible to use to select statements in a stored procedure? I am building a movie rating system, what I am doing is creating a table with movies and individual user ratings. The code needs to get a count of the ratings, then the sum of them to get the percentage. I am getting a error Exception Details: System.IndexOutOfRangeException: columncount
0
9571
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9838
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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

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.