knowledge base. It tells how to create a DataSetHelper class to select
DISTINCT from a column in a table within a dataset. I modified the code to
work in my project and it does exactly what I want.
"beschler" wrote:
> Rad wrote: "Given the constraints of your ODBC drivers, wouldn't it be better
> to store the bits you're looking for separately?"
>
>
> I'm not sure what you mean.
>
> Here's exactly what I am doing currently:
> I retrieve the record set from the ODBC provider using a datareader.
> I loop through the RS.
> For each jobno that matches my criteria, I extract the part of the string
> that I need and populate the ds with that string.
> Unfortunately, with the example I gave, that returns three identical records
> in the DS and I only need one.
> I could alter the SELECT in the ODBC driver to only pull in one of those
> three "prefixes" i.e. "1001" however, they change every year of the contract
> and might change more frequently depending on contract requirements.
>
> What I would like to do is be able to retrieve all the records from the ODBC
> driver (which is slow even by ODBC standards) into a local ds (or whatever)
> and then filter (OR SELECT DISTINCT) the local ds (or whatever) and use that
> to populate the ds that is passed in the web service.
>
> One other thought just came to mind. What if I create a collection for the
> JobNos? A collection, by it's nature will not allow duplicates, correct? As
> I populate the collection, I could set the error handling to ignore those
> duplicate errors and then iterate the collection to populate the ds.
>
> Any help is appreciated.
> Thanks,
>
>
>
> "Rad [Visual C# MVP]" wrote:
>
> > On Thu, 19 Apr 2007 13:28:01 -0700, beschler wrote:
> >
> > > That will not work. Here's why:
> > > There will be multiple variations of a jobno that will only differ in the
> > > first 4 characters, like this:
> > > 1001ABCDE071111A111
> > > 1003ABCDE071111A111
> > > 1008ABCDE071111A111
> > >
> > > I only need to retrieve the string starting in position 5 and I only need it
> > > one time no matter how many times it appears in the data.
> > > The ODBC client does not support any kind of string manipulation
> > > (LEFT,RIGHT,SUBSTRING, etc.).
> > >
> > > I only need part of the jobno
> > >
> > > "Jim Rand" wrote:
> > >
> > >> SELECT Job_No,Job_Cnct_No
> > >> FROM JC_JOBM
> > >> WHERE JOB_STATUS = 'O'
> > >> GROUP BY Job_No, Job_Cnct_No
> > >> ORDER BY Job_No;
> > >>
> > >>
> >
> > Given the constraints of your ODBC drivers, wouldn't it be better to store
> > the bits you're looking for separately?
> > --
> > Bits.Bytes
> >
http://bytes.thinkersroom.com