Results 1 to 3 of 3

Thread: get data from dataset

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    471

    get data from dataset

    I want to get the max column value from a table, the following is my code:
    VB Code:
    1. Dim dsTemp As DataSet = New DataSet()
    2.             Dim daTemp As OdbcDataAdapter = New OdbcDataAdapter("Select Max(id) as MaxID from teacher", connTeacher)
    3.             daTemp.Fill(dsTemp, "teacher")

    How can I get the value of the MaxID?

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Lots of different ways. One would be:
    Code:
    strID = dsTemp.Tables("teacher").rows(0).item(0)
    messagebox.show(strID)
    I haven't seen odbcadapter, though. Sure you don't mean oledbdataadapter? Maybe it's a reference I haven't used.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    471
    thanks for your reply.

    I use mySql database, it uses odbc data provider.

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