untyped datatable searching

G

Guest

hey all,
if i have an untyped datatable of, say, employee id's.

Emp ID, Name
14, John
14, John
2, Tom
3, Sally

How can I search the datatable to find if EmpID 14 even exists in the table?

thanks,
rodchar
 
R

RobinS

When you say "untyped datatable", what do you mean? Do you mean it's a
datatable you defined, not a strongly typed one?

Here's an example. It's in VB, but you get the general idea.


dt.PrimaryKey = New DataColumn() {dt.Columns("OrderID"),
dt.Columns("ProductID")}
Dim objCriteria As New Object() {10643, 28}
Dim row As DataRow = dt.Rows.Find(objCriteria)


Robin S.
 

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