facing problem while executing vb.net query

前端 未结 7 974
情深已故
情深已故 2020-12-12 07:24
Dim con As SqlConnection
        con = New SqlConnection(\"server=chinna; uid=sa; pwd=136018@h; database=icms\")
        con.Open()
        Dim cmd As SqlCommand
            


        
7条回答
  •  时光说笑
    2020-12-12 08:16

    Use ExecuteScalar instead of ExecuteReader.

    Dim password As String
    password = cmd.ExecuteScalar.ToString()
    

    FYI, storing passwords in plain text and comparing like this is VERY bad practice. You should be encrypting the passwords with some one-way salted encryption and then doing the same on verification then comparing the encrypted values.

提交回复
热议问题