I might approach this a bit differently. How about binding the list of valid
customer IDs (in the DataTable) to a dropdown list in the UI. That way the
user does not enter a number at all but pick from a list of known good
values.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit
www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
The absence of a query engine is what's making things a bit more difficult
than they need be then? For example I wanted to validate the existence of
a Customer ID entered in a form textbox. At first I was going to run a
query against the source tables, but then I remembered that I already had
a valid list of Customer ID's in the DataSet (used to populate an adjacent
combo box). The difficulty was how to query them for the existence of the
Customer ID. Eventually (after quite some fiddling around) I have settled
on:
CType(Me.NorthwindDataSet.bdl_CustomersByName.Compute("Count(CustomerID)",
"CustomerID = '" & txt.Text.Trim.ToUpper & "'"), Boolean)
Mainly because I get a count of 1 or 0 back which lends itself to a
boolean Yes/No answer. But is this the best way of doing it? I'd rather
do a simple Select statement against the DataTable.
Des