Javlja mi gresku "ExecuteNonQuery: Connection property has not been initialized."
ali ne vidim zasto do toga dolazi pa ako imate neke sugestije i idejebicu zahvalan...
Hvala unapred.
Code:
....
{
private ConnectToAccess baza;
private string tabela = "TABELA";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnOK_Click(object sender, EventArgs e)
{
int vrednost = Convert.ToInt32(txtPocetniBroj.Text);
int krajnji = Convert.ToInt32(txtKrajnjiBroj.Text);
try
{
if (vrednost <= krajnji)
{
baza = new ConnectToAccess(Server.MapPath("xxxxxxx.mdb"));
string[] kolone_novi_zapis = new string[] { "atribut1", "atribut2", "atribut3", "VREDNOST", "atribut4" };
string[] verdnosti_novi_zapis = new string[] { "\'" + atribut1.Text + "\'", "\'" + atribut2.Text + "\'", "\'" + atribut3.Text + "\'","'" + vrednost + "'", "\'" + atribut4.Text + "\'" };
int rez_unos_podataka = baza.AccessUpisiPodatak(verdnosti_novi_zapis, kolone_novi_zapis, tabela);
if (rez_unos_podataka > 0)
vrednost++;
else
lblTest.Text = "greska";
}
else
{
lblTest.Text = "greska";
}
}
catch
{
}
}
}
....
{
private ConnectToAccess baza;
private string tabela = "TABELA";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnOK_Click(object sender, EventArgs e)
{
int vrednost = Convert.ToInt32(txtPocetniBroj.Text);
int krajnji = Convert.ToInt32(txtKrajnjiBroj.Text);
try
{
if (vrednost <= krajnji)
{
baza = new ConnectToAccess(Server.MapPath("xxxxxxx.mdb"));
string[] kolone_novi_zapis = new string[] { "atribut1", "atribut2", "atribut3", "VREDNOST", "atribut4" };
string[] verdnosti_novi_zapis = new string[] { "\'" + atribut1.Text + "\'", "\'" + atribut2.Text + "\'", "\'" + atribut3.Text + "\'","'" + vrednost + "'", "\'" + atribut4.Text + "\'" };
int rez_unos_podataka = baza.AccessUpisiPodatak(verdnosti_novi_zapis, kolone_novi_zapis, tabela);
if (rez_unos_podataka > 0)
vrednost++;
else
lblTest.Text = "greska";
}
else
{
lblTest.Text = "greska";
}
}
catch
{
}
}
}
sve je s***** osim pishanja