Hello all, I have a tutorial which helped me with inserting into a MS SQL database. Currently, I want to write a SELECT Query but I'm facing difficulties. I actually want to implement a user login. Someone should please help me out. Thank you in advance.Partial Class AdminLogin
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
lblLoginFailed.Visible = False
End Sub
Protected Sub txtStaffLogIn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtStaffLogIn.Click
Dim StruserName As String = txtAdminUserID.Text.ToString()
Dim Strpassword As String = txtAdminPassword.Text.ToString()
Dim hdDataSource As New SqlDataSource()
hdDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("hotelpauldbConnectionString1").ToString()
hdDataSource.SelectCommandType = SqlDataSourceCommandType.Text
hdDataSource.SelectCommand = "SELECT username, password FROM [user] WHERE username = @username AND password = @password"
hdDataSource.SelectParameters.Add("userName", StruserName)
hdDataSource.SelectParameters.Add("password", Strpassword)
Dim rowsAffected As Integer = 0
Try
rowsAffected = hdDataSource.Select()
Catch ex As Except
View Complete Post