ADO.NET, Sql2K5 - true hack...

Peter Osucha <[email protected]> Sat, 21 Apr 2007 14:43:45 -0400
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
This seems like a true 'hack'.  Perhaps someone can give me a better way
to do this.

 

I have an SQL2K5 sp that returns up to 3 datasets (before telling me to
not return more than 1 dataset, please let me know of a better way to do
this! J).  The first dataset is always returned.  Due to the arguments
used to call the sp, there is a chance that the normal 'second' dataset
won't be returned, the normal 'third' dataset won't be returned, or that
neither the normal 'second' nor the normal 'third' dataset will be
returned.

 

In order to tell in my C# app which dataset I am working with (I keep
looking for new datasets with a 

 

'while ( dr.NextResult ( ) ) {}'

 

block of code), I am using a 'hack' of adding an extra column to the
returned dataset ('FromTabel1' or 'FromTable2', etc.) so that I can
check the datareader.GetOrdinal() to see which dataset I am really
dealing with.

 

If I have explained well enough what I am doing, can someone please
provide me a better way to check a returned dataSet for my purpose?

 

Peter

 


===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com