Home All Groups Group Topic Archive Search About

DataSet and SQL results dont match, help

Author
1 Feb 2007 4:17 PM
JP
As anyone ever run into this before. VS 2005 C#. This is a combination of SQL
and framework so I wasn’t quite sure where to post it.

I have a SP that executes multiple SELECT statements. If the ROWCOUNT = 0 it
executes the next SELECT and so fourth. In the past its always been that the
last SELECT executed would be the results that were returned to whatever
objAdapter executed the SP.

However, I’ve noticed that the results in the data adapter always contain
the results of the first SELECT. So if SELECT #1 returned 0 records and the
last SELECT returned 3 records, the dataset would have 0 records.

Is this a bug? How can it be fixed?

--
JP
..NET Software Developer

Author
1 Feb 2007 4:31 PM
pvdg42
Show quote
"JP" <J*@discussions.microsoft.com> wrote in message
news:01C4560E-EC44-432E-94F2-5D654E266702@microsoft.com...
> As anyone ever run into this before. VS 2005 C#. This is a combination of
> SQL
> and framework so I wasn't quite sure where to post it.
>
> I have a SP that executes multiple SELECT statements. If the ROWCOUNT = 0
> it
> executes the next SELECT and so fourth. In the past its always been that
> the
> last SELECT executed would be the results that were returned to whatever
> objAdapter executed the SP.
>
> However, I've noticed that the results in the data adapter always contain
> the results of the first SELECT. So if SELECT #1 returned 0 records and
> the
> last SELECT returned 3 records, the dataset would have 0 records.
>
> Is this a bug? How can it be fixed?
>
> --
> JP
> .NET Software Developer
>
In order to address your question, we'd need to see your code. Can you show
the selection logic block, or better still, reproduce the symptoms in a
short, but complete program?
Author
1 Feb 2007 10:07 PM
Robson Siqueira
JP,

If you are using DataReader, make sure you go for the next result set.
Normally I don't use data adapters, I fill the data set by myself or I use
the Microsoft Application Blocks for that.

I hope it helps.

--
Regards,
Robson Siqueira
Enterprise Architect
Show quote
"pvdg42" <pvdg42@newsgroups.nospam> wrote in message
news:%230fQB6hRHHA.496@TK2MSFTNGP06.phx.gbl...
>
> "JP" <J*@discussions.microsoft.com> wrote in message
> news:01C4560E-EC44-432E-94F2-5D654E266702@microsoft.com...
>> As anyone ever run into this before. VS 2005 C#. This is a combination of
>> SQL
>> and framework so I wasn't quite sure where to post it.
>>
>> I have a SP that executes multiple SELECT statements. If the ROWCOUNT = 0
>> it
>> executes the next SELECT and so fourth. In the past its always been that
>> the
>> last SELECT executed would be the results that were returned to whatever
>> objAdapter executed the SP.
>>
>> However, I've noticed that the results in the data adapter always contain
>> the results of the first SELECT. So if SELECT #1 returned 0 records and
>> the
>> last SELECT returned 3 records, the dataset would have 0 records.
>>
>> Is this a bug? How can it be fixed?
>>
>> --
>> JP
>> .NET Software Developer
>>
> In order to address your question, we'd need to see your code. Can you
> show the selection logic block, or better still, reproduce the symptoms in
> a short, but complete program?
>
>
>

AddThis Social Bookmark Button