i analysized the adress which you gave . it is useful for me . Thanks.
but there is an another problem
the codes are below
Code:
private void pgiris_Click(object sender, EventArgs e)
{
string queryString = "SELECT p_name,p_pass from personel";
using (OleDbConnection dbconnection=new OleDbConnection(connectionString))
{
MessageBox.Show("ok");
OleDbCommand command =new OleDbCommand(queryString, dbconnection);
dbconnection.Open();
OleDbDataReader reader = command.ExecuteReader();
// Call GetOrdinal and assign value to variable.
string pname = reader["p_name"].ToString(); //THE ERROR WAS HERE
string ppass = reader["p_pass"].ToString();
// Use variable with GetString inside of loop.
while (reader.Read())
{
if ((pname == pad_text.Text) && (ppass == psifre_text.Text))
{
MessageBox.Show("it is ok");
}
else
{
MessageBox.Show("it is not ok");
}
}
// Call Close when done reading.
reader.Close();
}
}
when i compile the program there is no error, after i ran the program and enter the
password and username the error occurs. The error is invalid operation exception and says no data exists row/column.
I checked the database, there are datas.
what can i do now?