"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