Results 1 to 2 of 2

Thread: How to read from database?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    10

    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
    Last edited by afham07; May 3rd, 2008 at 07:19 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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:
    1. 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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width