开发者

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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜