How to read from database?
Hi,
I am facing 1 problem which is read data from database. How to write something like this:
1. take a data value in a field (say named "A")
2. if a taken data is < 10, then move to next data.
how to trace the above stament?
btw, I want to build a reminder program using visual basic 2005
Re: How to read from database?
If you want to get all the records where a certain column contains a value of 10 or greater then just execute an appropriate query, e.g.
SQL Code:
SELECT * FROM MyTable WHERE MyColumn >= 10
Follow the Data Access link in my signature for examples of how to execute queries if you need it.
Once you've got the result set you can either loop through the data in a DataReader or DataTable.