Distinct Values from a Datatable

R

rbutch

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...
 
R

rbutch

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top