Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataColumn from DataSet

Status
Not open for further replies.

lee2k

Programmer
Aug 19, 2001
28
0
0
IN
Hi,
I have a DataSet which has a column with repeated values. I want to extract the unique values (of that particular column) out of that dataset and should assign the values to a DataColumn. Is this possible?
Thanks in advance
-Lee2k
 
dim dt as datatable=MyDataSet.Tables("MyTableName")
dt.columns.add(new DataColumn("MyUniqueVal"))
for each rw as datarow in dt.rows
dim v as object=rw("MyLookUpColumn")
if tbl.select("MyLookColumn='" & v & "'").length=1 then
rw("MyUniqueVal")=v
end if

next

Keeping it Real, Simple!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top