Code:
If TxtName2.Text = "" Then
MsgBox("please give a Folder Name")
Exit Sub
Else
qry1 = "insert into soft (Folderneym"
qry2 = ") values ( " & TxtName2.Text & "'"
End If
If TxtName2.Text = "" Then
MsgBox("please give a Folder Name")
Exit Sub
Else
qry1 = "insert into soft (Folderneym"
qry2 = ") values ( " & TxtName2.Text & "'"
End If
Public Function LoginToSystemParameterized(un As String, pwd As String) As Boolean
Dim count As Integer = 0
Using conn = New SqlConnection("YourConnectionStringHere")
Dim sql As String = "SELECT COUNT(userId) FROM users WHERE userName = @username AND password = @password"
Using cmd = New SqlCommand(sql, conn)
conn.Open()
cmd.CommandType = System.Data.CommandType.Text
'now add our parameters
cmd.Parameters.AddWithValue("@username", un)
cmd.Parameters.AddWithValue("@password", pwd)
count = Convert.ToInteger(cmd.ExecuteScalar())
End Using
End Using
Return If(count > 0, True, False)
End Function
Comment