lampej
lampej

Reputation: 258

VB.Net MySql command parameter MD5

Is it possible to execute a command like this?

select * from tbl where col1=somefunction(@param1)

or will the parameter throw off the function? I have been unsuccessful in getting the command to work so far.

Please let me know if this needs any further explanation and thank you in advance!

Upvotes: 2

Views: 2138

Answers (1)

SkyDrive
SkyDrive

Reputation: 1455

IN VBNet:

Shared Sub Main()
    con = New MySqlConnection("Your ConnectionString") 

    Dim cmd As New MySqlCommand("select * from tbl where col1 = somefunction(@param1)", con)
    cmd.Parameters.AddWithValue("param1","value HEre")

    Try
        con.Open()
        Dim reader As MySqlDataReader = cmd.ExecuteReader()
        While reader.Read()
            Console.WriteLine("{0}", reader.GetString(0))
        End While
        reader.Close()
    Finally
        con.Close()
    End Try
End Sub

Upvotes: 1

Related Questions