Menu

How to retreive rows from db?

2004-01-05
2004-01-06
  • Bahman Parizadeh

    Hi,

    I'm having trouble understanding how i can retrieve a set of rows from one table in the db using the framework?  i have a drop down in an asp application that i want to populate with all the names in a user table. How would i go about doing this.  Any syntax would help

    thanks,

    Bo

     
    • Richard Banks

      Richard Banks - 2004-01-06

      Hi Parizad,
      It's a fairly simple process.

      You need to create a retrieve criteria, execute it and then access the data contained in the resulting cursor.

      Here's an example...

          Dim rc As CRetrieveCriteria
          Dim emp As New CEmployee
          Dim cursor As CCursor

          emp = New CEmployee
          rc = New CRetrieveCriteria
          rc.ReturnFullObjects = True
          cursor = rc.perform(emp)
          If cursor.hasElements Then
            cursor.loadObject(emp)
            Debug.WriteLine(emp.Name)
          End If

      You can access the recordset directly in the cursor objects resultset.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.