473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why recordset going to second table in dataset?

I am using the Enterprise library and did an executedataset to retrieve
results into a dataset. I noticed that the result went into the second
table in the table collection of the dataset instead of the first table.

ds.Tables[0].Rows.count = 0 <--- why?
while
ds.Tables[1].Rows.count had the number of rows expected.

Is there a reason for this behaviour?

John Dalberg
Dec 12 '05 #1
3 1135
John Dalberg wrote:
I am using the Enterprise library and did an executedataset to
retrieve results into a dataset. I noticed that the result went into
the second table in the table collection of the dataset instead of
the first table.

ds.Tables[0].Rows.count = 0 <--- why?
while
ds.Tables[1].Rows.count had the number of rows expected.

Is there a reason for this behaviour?

John Dalberg

Are you using a SQL Server stored procedure? If so, did you remember to use
"SET NOCOUNT ON" in the procedure to suppress the informational "x rows were
affected" messages that are sent as resultsets?
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Dec 13 '05 #2
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote:
John Dalberg wrote:
I am using the Enterprise library and did an executedataset to
retrieve results into a dataset. I noticed that the result went into
the second table in the table collection of the dataset instead of
the first table.

ds.Tables[0].Rows.count = 0 <--- why?
while
ds.Tables[1].Rows.count had the number of rows expected.

Is there a reason for this behaviour?

John Dalberg

Are you using a SQL Server stored procedure? If so, did you remember to
use "SET NOCOUNT ON" in the procedure to suppress the informational "x
rows were affected" messages that are sent as resultsets?


The sp was created using VS2003 using the dataadaptor designer. Yes there's
a 'set no nocount on' statement which was put by vs2003. All the sp does is
a select using a join between two tables.

When I run the sp in the query analyzer, I only see a single row which is
expected. I am posting the sp below.

CREATE PROCEDURE dbo.GetCustomers
AS
SET NOCOUNT ON;
SELECT Customer.CustName, Contact.ContactName FROM Customer CROSS JOIN
Contact GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Dec 13 '05 #3
KJ
There might be a select statement (in your sql) somewhere above that
which is returning the rows. If not, I don't know the answer.

Dec 13 '05 #4

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

Similar topics

19
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
3
by: Kevin Rollo | last post by:
I'm playing with a generic routine to export data, the concept is to have a list of data driven templates defining what fields to output. Evaluating a simple variable field name in the function...
0
by: Thaddeus | last post by:
//Author: //Thaddeus Jacobs, MCP //Kinematic Automation, Inc. //mailto:tjacobs@kinematic.com // //Description: //convert ADO .NET dataset to ADO 2.5 2.6 2.7 recordset and v/v //DataSet to...
5
by: tony010409020622 | last post by:
I just spent 4 months taking a dotnet class where i learned very little. One of the things I did not learn is this: What are the dotnet equivilents of commands such as: Adodc1.Recordset.AddNew...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
6
by: James | last post by:
I am writing a web service for a classic ASP application. I need to consume an ADO recordset and then send it to another web service for processing. I found an MSDN ariticle telling how to do this...
5
by: Wendy | last post by:
Hi I'm trying to import the contents of a text file which is basically letters in to a table to add more data to them. The original file comes from the mainframe. I'm tring to copy the...
4
by: =?Utf-8?B?R3JlZw==?= | last post by:
My background is in MS Access and I am in the process of migrating my skillsets to Visual Basic.Net. So far I am able to display data in DataGridViews and Combo Box, etc with not problem. What I'm...
2
by: john0600 | last post by:
I'm writing a web service in .NET to work with Delphi clients. Delphi uses ADO so I want to convert the Dataset to a Recordset and vice- versa. It appears a Web Service cannot publish a web method...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.