Re: filter dataset?? by Steve
Steve
Mon Jul 28 08:41:30 CDT 2003
You can bind to a DATAVIEW,
When binding, bind to the DEFAULTVIEW, them set a row filter on this view.
myDS.Tables[0].Select("TypeName=Premier"') will return a DATATABLE with the
rows in that match the filter, but if its just for binding why bother
creating a new dataset with a new table, why not just bind to a dataview.
Cheers
Steve
"John Pether" <john@john.com> wrote in message
news:eM89J0PVDHA.2344@TK2MSFTNGP09.phx.gbl...
> Are you saying that instead of filtering the full dataset to another
dataset
> and dinding it to the datalist, I can just filter the master dataset and
> bind that to the datalist?
>
> so if I have a datalist plusDL I could do this??? Actually, tried that and
> it doesn't work...LOL
>
> plusdl.DataSource = myDS.Tables[0].Select("TypeName=Premier")
>
> I presume <code>myDS.Tables[0].Select("TypeName=Premier"')</code> selects
> all rows that contain TypeName=Premier???...hmmmm getting confused now
>
> Thx for your help:):)
>
>
>
>
> "Steve Drake" <Steve@_NOSPAM_Drakey.co.uk> wrote in message
> news:eCSdxlPVDHA.2192@TK2MSFTNGP10.phx.gbl...
> > Does this help :
> >
> > YourDataSet.Tables[0].Select("Col = value")
> >
> > This will return a datatable.
> >
> >
> >
> >
> > "John Pether" <john@john.com> wrote in message
> > news:eJFUGqOVDHA.1480@tk2msftngp13.phx.gbl...
> > > I have a dataset and i want to filter it into a new dataset or reader.
I
> > > have the following code below but do not know how to finish it. I want
> to
> > > inport all rows where the TypeName column = a certain value (premier
> plus)
> > > Some help would be appreciated:)
> > >
> > > Dim links As New DNSite.LinksDB()
> > >
> > > Dim myDS As DataSet
> > >
> > > myDS = links.GetLinks(CatID)
> > >
> > > ' filter dataset for premier plus links
> > > ' and bind to the datalist control
> > >
> > > Dim pluslinks As New DataSet()
> > >
> > > pluslinks.Tables.Add(myDS.Tables("tblLinks").Clone)
> > >
> > > pluslinks.Tables(0).ImportRow(myDS.Tables("tblLinks").???
> > >
> > >
> > >
> > >
> >
> >
>
>