Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27064

VS 2010 MySQL Select From Error

$
0
0
Ok, so I have:

Code:

Dim SQLQuery = "SELECT * FROM HWID WHERE IP = " & WC.DownloadString("https://secure.internode.on.net/webtools/showmyip?textonly=1") & ""
When I run a check on it:

Code:

MsgBox(SQLQuery.ToString)
It says:

Code:

SELECT * FROM Ban WHERE IP = XXX.XXX.X.XX
Isn't it supposed to just say the IP address? Because, it's not working when I check my IP with the IP I have in my database. I have it like this:

Code:

        Dim MyAdapter As New MySqlDataAdapter
        Dim WC As New System.Net.WebClient
        Dim SQLQuery = "SELECT * FROM HWID WHERE IP = " & WC.DownloadString("https://secure.internode.on.net/webtools/showmyip?textonly=1") & ""
        MsgBox(SQLQuery.ToString)
        Dim MyCommand As New MySqlCommand()
        MyCommand.Connection = Connection
        MyCommand.CommandText = SQLQuery
        MyAdapter.SelectCommand = MyCommand
        Dim MyData As MySqlDataReader
        MyData = MyCommand.ExecuteReader
        If MyData.HasRows = False Then
            MsgBox("ip not here
        Else
            MsgBox("ip here")
    End If

So, even though the IP is In my database, I always receive the "ip not here" msgbox.

Viewing all articles
Browse latest Browse all 27064

Trending Articles