Hey everybody,
I am building a web application that is limited to one database, thus I cannot use the handy ASP.NET config tool. I am attempting to use SqlClient to authenticate users from a user table I added to my database. Here is the code I have thus far:
Dim sqlCommand As SqlCommand = New SqlCommand
Dim sqlConnect As SqlConnection = New SqlConnection
Dim sqlReader As SqlDataReader
sqlConnect.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CLIENT_PAYMENT.mdf;Integrated Security=True;User Instance=True"
sqlCommand.CommandText = "SELECT * FROM USER WHERE UserName=@UserName AND Password=@Password"
sqlCommand.Parameters.AddWithValue("@UserName", strUser)
sqlCommand.Parameters.AddWithValue("@Password", strPass)
sqlCommand.Connection = sqlConnect
sqlConnect.Open()
sqlReader = sqlCommand.E ...
Go to the complete details ...