void LoginBtn_Click(Object sender, EventArgs e) { if (Page.IsValid) { System.Data.DataSet userDS = GetUser(UserName.Text, UserPass.Text) ; ** the error happens here with the debugger saying that "(" is expected. if userDS.Tables(0).Rows.Count = 1 { FormsAuthentication.RedirectFromLoginPage(UserName.Text, true); } else { Msg.Text = "Invalid Credentials: Please try again"; } } } System.Data.DataSet GetUser(string userName, string userPassword) { string connectionString = "server=\'(local)\'; user id=\'sa\'; password=\'\'; database=\'Orders\'"; System.Data.IDbConnection dbConnection = new System.Data.SqlClient.SqlConnection(connectionString); string queryString = "SELECT [Users].* FROM [Users] WHERE (([Users].[UserName] = @UserName) AND ([Users" + "].[UserPassword] = @UserPassword))"; System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand(); dbCommand.CommandText = queryString; dbCommand.Connection = dbConnection; System.Data.IDataParameter dbParam_userName = new System.Data.SqlClient.SqlParameter(); dbParam_userName.ParameterName = "@UserName"; dbParam_userName.Value = userName; dbParam_userName.DbType = System.Data.DbType.String; dbCommand.Parameters.Add(dbParam_userName); System.Data.IDataParameter dbParam_userPassword = new System.Data.SqlClient.SqlParameter(); dbParam_userPassword.ParameterName = "@UserPassword"; dbParam_userPassword.Value = userPassword; dbParam_userPassword.DbType = System.Data.DbType.String; dbCommand.Parameters.Add(dbParam_userPassword); System.Data.IDbDataAdapter dataAdapter = new System.Data.SqlClient.SqlDataAdapter(); dataAdapter.SelectCommand = dbCommand; System.Data.DataSet dataSet = new System.Data.DataSet(); dataAdapter.Fill(dataSet); return dataSet;