rodchar,
In addition to Bernie's suggestion.
How big a table are you checking against?
If the table is not too large, I would create a DataTable out of it, define
a primary key, then use the Contains method.
Something like:
' define the table, only really need the primary keys
Dim table As New DataTable
table.Columns.Add("id", GetType(Integer))
table.PrimaryKey = New DataColumn() {table.Columns("id")}
' check to see if the row is in the table.
Dim key As Integer
If table.Rows.Contains(key) Then
End If
If you want to check the entire record, I would define all the fields as
keys. Contains is overloaded to accept a single value as above or an array
of values...
If the table is too large, I would use SQL do have the database itself check
for the record (with a SELECT statement or a Unique constraint).
Hope this helps
Jay
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
Hey all,
If I need to just validate a single record against a table to see if it
exist, what's the best /fastest method to do this? shoud I create a table
in
my dataset for such a task? this is an asp.net.vb app.
thanks,
rodchar