Salut je tente de faire un form d'authentification et voila l'erreur que je recois:
Exception Details:
System.InvalidOperationException: The SelectCommand property has not been initialized before calling 'Fill'.
Line 40: void Login()
Line 41: {
Line 42: sqlDataAdapter1.Fill(dataSet11);
Line 43: if (txtuser.Text != "")
Line 44: {
Voila mon code:
void Login()
{
sqlDataAdapter1.Fill(dataSet11);
if (txtuser.Text ! = "")
{
for (int i = 0; i < dataSet11.logs.Count; i++)
{
DataSet1.logsRow row = dataSet11.logs[i];
if (row.login == txtuser.Text)
{
if (row.password == txtpass.Text)
{
FormsAuthentication.RedirectFromLoginPage(txtuser.Text,false);
}
}
}
}
else
lblcheck.Text="acces refuse";
}
private void btnsend_Click(object sender, System.EventArgs e)
{
Login();
}
Quelqu'un pourrait-il m'aider? Merci.