|
-
Apr 6th, 2004, 09:34 AM
#1
Thread Starter
Hyperactive Member
get data from dataset
I want to get the max column value from a table, the following is my code:
VB Code:
Dim dsTemp As DataSet = New DataSet()
Dim daTemp As OdbcDataAdapter = New OdbcDataAdapter("Select Max(id) as MaxID from teacher", connTeacher)
daTemp.Fill(dsTemp, "teacher")
How can I get the value of the MaxID?
-
Apr 6th, 2004, 09:48 AM
#2
Frenzied Member
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.
-
Apr 6th, 2004, 10:00 AM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|