HighTechTalks DotNet Forums  

Select MAX statement only returns true not the actual number???

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss Select MAX statement only returns true not the actual number??? in the Dotnet Framework (ODBC.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Select MAX statement only returns true not the actual number??? - 05-08-2005 , 09:30 AM






G'Day all,
Heres my code:

Dim MyConString As String = "DRIVER={MySQL ODBC 3.51
Driver};SERVER=localhost;DATABASE=phpbb_forums;UID =root;PASSWORD=joeblogs;OPTION=3"

Dim MyConnection = New OdbcConnection(MyConString)

Dim MDBGetRow As New OdbcCommand("SELECT MAX(user_id) FROM
phpbb_users", MyConnection)

MyConnection.Open()

Dim MDBreader As OdbcDataReader

MDBreader = MDBGetRow.ExecuteReader

MessageBox.Show(MDBreader.Read)

MyConnection.close()

Now when I run that all I get in the messagebox.show() is true.

Now the user_id column is all numbers (no text at all) and its
properties are "mediumint". If I execute the sql statement using say
navicat or another sql management program it returns the max number in
the column so I figure it must be something to do with my code. Any
ideas?

Cheers all

Dave.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.