i supposed it can show the result of count(ID), in this instant it is the number of recordsCode:Private Sub cmdLogin_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles cmdLogin.Click Dim conn As MySqlConnection conn = New MySqlConnection() conn.ConnectionString = "server=" & txtServer.Text & ";" _ & "user id=" & txtUsername.Text & ";" _ & "password=" & txtPassword.Text & ";" _ & "database=db1" Dim myCommand As New MySqlCommand Dim SQL As String SQL = "SELECT COUNT(ID) FROM OUTBOX " Try conn.Open() myCommand.Connection = conn myCommand.CommandText = SQL myCommand.ExecuteNonQuery() Debug.WriteLine(SQL) '<=====how to show it's result variable of records instead of showing only query conn.Close() Catch myerror As MySqlException MessageBox.Show("Error Connecting to Database: " & myerror.Message) Finally conn.Dispose() End Try End Sub
count on the OUTBOX so the debug.writeline is RESULT, instead of now it is showing "SELECT COUNT(ID) FROM OUTBOX"
can anybody help me out this problem? thanks


support clasicVB6
Reply With Quote