Searching for a specific record in a form

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hello,
I use the VS .NET 2003.
Say I have a Windows form (with C# code, of course) which is connected
to a database to one table. I can browse through the records, but I
don't know how to accomplish a search for a specific record.
I would like to have a button that by clicking it, a response window
will be opened. Say that the search will be according a specific
column of the table, so by filling a value to a Text Box for that
column and clicking an OK button - the desired record will show up.
Any detailed help will be appreciated.

David
 
If you want to search in the table Company for ID 385

dataset["company"].Select("ID = 385");

it returns an array of row that matches the criteria.

If your dataset is connected to a datasource, you can change the filter of
your defaultview property of the table into your dataset. .

That's it :-)

Laurent
 
Back
Top