Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Why recordset going to second table in dataset?

Reply
Thread Tools

Why recordset going to second table in dataset?

 
 
John Dalberg
Guest
Posts: n/a
 
      12-12-2005
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
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      12-12-2005
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"


 
Reply With Quote
 
 
 
 
KJ
Guest
Posts: n/a
 
      12-12-2005
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.

 
Reply With Quote
 
John Dalberg
Guest
Posts: n/a
 
      12-13-2005
"Bob Barrows [MVP]" <> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Trying to create a HTML table based on a recordset Brent Mondoux ASP .Net 0 06-30-2004 06:35 PM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM
Re: Why Is the Second Table Always to the Right of the First? Please Help! Hywel Jenkins HTML 1 08-07-2003 07:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57