[ EmirSuvalic @ 10.08.2012. 14:53 ] @
public void Konekcija()
{
DataTable dt = new DataTable();
DataSet ds = new DataSet();
ds.Tables.Add(dt);
con.Open();

OleDbDataAdapter da = new OleDbDataAdapter("select * from Korisnici", con);
da.Fill(dt);
string korisnik = comboBox1.Text.Trim();
string pass = textBox1.Text.Trim();
foreach (DataRow in dt.Rows)
{
if (((korisnik == DataRow.Equals[1]) && (pass == DataRow.Equals[2])))
{
con.Close();
return true;
}
}
con.Close();
return false;
}
[ Shadowed @ 10.08.2012. 15:07 ] @
U foreach imas samo DataRow. To je tip. Treba ti i tip i promenljiva. Stavi foreach (DataRow row in dt.Rows) pa unutar foreach bloka koriti row umesto DataRow.