开发者

VB.Net MySql command parameter MD5

开发者 https://www.devze.com 2023-01-01 20:26 出处:网络
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 wor

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 a开发者_如何学JAVAdvance!


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号