Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Type and identifier are both required in a foreach statement greška, POMOĆ!

[es] :: .NET :: Type and identifier are both required in a foreach statement greška, POMOĆ!

[ Pregleda: 1474 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

EmirSuvalic
Student FIT
Mostar, BiH

Član broj: 279359
Poruke: 23
31.176.193.*



Profil

icon Type and identifier are both required in a foreach statement greška, POMOĆ!10.08.2012. u 14:53 - pre 142 meseci
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;
}
 
Odgovor na temu

Shadowed
Vojvodina

Član broj: 649
Poruke: 12848



+4784 Profil

icon Re: Type and identifier are both required in a foreach statement greška, POMOĆ!10.08.2012. u 15:07 - pre 142 meseci
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.
 
Odgovor na temu

[es] :: .NET :: Type and identifier are both required in a foreach statement greška, POMOĆ!

[ Pregleda: 1474 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.