guys, Has anyone tried this before?
i have a dataset and rather than doing an addtional trip to the server with a DISTINCT sql query - i'd like to just loop thru the existing dataset in memory.
i assign that dataset (ds) to a datatable, declare a datarow and then use the select property to get the distinct employee id.
i keep getting "Syntax error: Missing operand after 'EmplId' operator." and i've pretty much been out on the web looking for a solution to this.
any help is appreciated. snippet of the code is below.
thanks
rik

Dim oTable As DataTable = ds.Tables(0)
Dim myRow As DataRow
For Each myRow In oTable.Select("DISTINCT EmplId")
cboEmplList2.Items.Add(myRow.Item(0))
Next


**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Re: Distinct Values from a Datatable by W

W
Sun Jul 31 14:29:16 CDT 2005

http://support.microsoft.com/default.aspx?scid=kb;en-us;326176
"rik butcher" <rbutch@coair.com> wrote in message
news:Ok%23RBNglFHA.1968@TK2MSFTNGP14.phx.gbl...
> guys, Has anyone tried this before?
> i have a dataset and rather than doing an addtional trip to the server
> with a DISTINCT sql query - i'd like to just loop thru the existing
> dataset in memory.
> i assign that dataset (ds) to a datatable, declare a datarow and then use
> the select property to get the distinct employee id.
> i keep getting "Syntax error: Missing operand after 'EmplId' operator."
> and i've pretty much been out on the web looking for a solution to this.
> any help is appreciated. snippet of the code is below.
> thanks
> rik
>
> Dim oTable As DataTable = ds.Tables(0)
> Dim myRow As DataRow
> For Each myRow In oTable.Select("DISTINCT EmplId")
> cboEmplList2.Items.Add(myRow.Item(0))
> Next
>
>
> **********************************************************************
> Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
> ASP.NET resources...



Re: Distinct Values from a Datatable by Cor

Cor
Sun Jul 31 23:48:38 CDT 2005

Rik,

See this sample on our website

http://www.windowsformsdatagridhelp.com/default.aspx?ID=dcad9a66-1366-4d61-8d32-1a580eb893b2

I hope this helps,

Cor



Re: Distinct Values from a Datatable by rik

rik
Mon Aug 01 14:36:03 CDT 2005

guys, i appreciate the help. this'll definately save a round trip and is extrememly fast since it's already in memory.
thanks again
rik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...