• 24-09-2021, 10:45:43
    #1
    Merhabalar,
    Basit bir otomasyon programı hazırlıyorum ancak Visual Studio 2019 kullanırken alttaki hatayı alıyorum. Ne çözüm bulabildim nede hatanın kaynağını. Yarımcı olabilir misiniz?




    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;

    namespace StokTakipUygulamasi
    {
    public partial class frmMusteriEkle : Form
    {
    public frmMusteriEkle()
    {
    InitializeComponent();
    }
    SqlConnection baglanti = new SqlConnection(@"Data Source=DESKTOP-RO6DJ2IIBRAHIM;Initial Catalog=Stok_Takip;Integrated Security=True");
    private void frmMusteriEkle_Load(object sender, EventArgs e)
    {

    }

    private void button1_Click(object sender, EventArgs e)
    {
    baglanti.Open();
    SqlCommand komut = new SqlCommand("insert into musteri(vergino,adsoyad,telefon,adres,email) values(@vergino,@adsoyad,@telefon,@adres,@email)", baglanti);
    komut.Parameters.AddWithValue("@vergino", txtvergi.Text);
    komut.Parameters.AddWithValue("@adsoyad", txtadsoyad.Text);
    komut.Parameters.AddWithValue("@telefon", txttelefon.Text);
    komut.Parameters.AddWithValue("@adres", txtadres.Text);
    komut.Parameters.AddWithValue("@email", txtemail.Text);
    komut.ExecuteNonQuery();
    baglanti.Close();
    MessageBox.Show("Müşteri Kayıdı Eklendi");
    foreach (Control item in this.Controls)
    {
    if (item is TextBox)
    {
    item.Text = "";
    }
    }
    }
    }
    }
  • 24-09-2021, 10:47:11
    #2
    "musteri" diye birşey tabloda yok diyor.
  • 24-09-2021, 10:50:43
    #3
    Heser adlı üyeden alıntı: mesajı görüntüle
    "musteri" diye birşey tabloda yok diyor.
    Çok teşekkür ederim çözdüm sorunu.