Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Syntax error in INSERT INTO statement

$
0
0

Hi, I have a syntax error while trying to insert my data to Access database. I could not find where the error is. My ex.Message is Syntax error in INSERT INTO statement. Could you help me?

                string Sorgu = "INSERT INTO SarjVerileri (Ad, Soyad, EPosta, TelefonNum, DogumTar, PinKodu" + "VALUES(" + this.Ad + ", '" + this.Soyad + "', '" + "', '" + this.EPosta + "', '" + this.TelefonNum + "', '" + this.DogumTar + "', '" + this.PinKodu + "')";

                string sorgu = "INSERT INTO KasaKontrol (KasaNumarasi, CepTelefonu, MusPinKodu" + "VALUES(" + this.KasaNum + "', '" + this.TelefonNum + "', '" + this.PinKodu + "')";

                if (bag.State == ConnectionState.Closed)
                    bag.Open();

                komut.CommandText = Sorgu;
                komut.Connection = bag;
                komut.ExecuteNonQuery();
                bag.Close();

                if (bag.State == ConnectionState.Closed)
                    bag.Open();
                komut.CommandText = sorgu;
                komut.Connection = bag;
                komut.ExecuteNonQuery();
                bag.Close();


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>