1
Answer

asp.net and access

gokhan karatas

gokhan karatas

16y
3.2k
1
hello, i tried to connect access database. and adding row in db. all of them is ok but when i start the project, it gave an error. error is "insert into". i did it so:


string sorgu = "insert into oyuncu_tablo(no,isim,soyisim,degerbir,degeriki,degerbirim,maasbir,maasiki,maasbirim,yas,boy,kilo,hiz,dayaniklilik,oyun_zekasi,paslasma,sut_cekme,kafa_vurusu,kalecilik,top_konturolu,top_calma,orta_yapma,duran_toplar,tecrube,form) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

OleDbCommand cmd = new OleDbCommand(sorgu, db_baglanti);

i=0;

cmd.Parameters.AddWithValue("@no", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@isim", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@soyisim", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@degerbir", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@degeriki", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@degerbirim", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@maasbir", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@maasiki", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@maasbirim", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@yas", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@boy", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@kilo", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@hiz", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@dayaniklilik", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@oyun_zekasi", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@paslasma", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@sut_cekme", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@kafa_vurusu", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@kalecilik", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@top_konturolu", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@top_calma", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@orta_yapma", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@duran_toplar", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@tecrube", veriler[i]);

i++;

cmd.Parameters.AddWithValue("@form", veriler[i]);

db_baglanti.Open();

cmd.ExecuteNonQuery();

db_baglanti.Close();

 

 

please help

Answers (1)