Soran
Windows Form Tasarımcısı hata sayfası

Genel Tartışma
-
Error CS1061: 'frmMüşteriEkle' does not contain a definition for 'frmMüşteriEkle_Load' and no accessible extension method 'frmMüşteriEkle_Load' accepting a first argument of type 'frmMüşteriEkle' could be found (are you missing a using directive or an assembly reference?) şeklinde bir hata alıyorum. Lütfen yardımcı olur musunuz?- Değiştirilmiş Tür Kyamuran SalibryamMicrosoft contingent staff, Moderator 9 Eylül 2020 Çarşamba 16:03
Tüm Yanıtlar
-
-
Metodu çağırırken eksik parametre vermişsiniz gibi duruyor ama illa ki hatalı satırı belirtiyordur. Bize biraz kod paylaşmalısınız.
-
-
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 WindowsFormsApp11
{
public partial class frmMüşteriEkle : Form
{
public frmMüşteriEkle()
{
InitializeComponent();
}
SqlConnection baglanti = new SqlConnection(@"Data Source=ASUS\SQLEXPRESS;Initial Catalog=Stok_Takip;Integrated Security=True");
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into müşteri(tc,adsoyad,telefon,adres,email) values(@tc,@adsoyad,@telefon,@adres,@email)", baglanti);
komut.Parameters.AddWithValue("@tc", txtTc.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 kaydı eklendi");
foreach (Control item in this.Controls)
{
if (item is TextBox)
{
item.Text = "";
}
}
}
}
} -
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 WindowsFormsApp11
{
public partial class frmMüşteriEkle : Form
{
public frmMüşteriEkle()
{
InitializeComponent();
}
SqlConnection baglanti = new SqlConnection(@"Data Source=ASUS\SQLEXPRESS;Initial Catalog=Stok_Takip;Integrated Security=True");
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into müşteri(tc,adsoyad,telefon,adres,email) values(@tc,@adsoyad,@telefon,@adres,@email)", baglanti);
komut.Parameters.AddWithValue("@tc", txtTc.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 kaydı eklendi");
foreach (Control item in this.Controls)
{
if (item is TextBox)
{
item.Text = "";
}
}
}
}
} -
-
-
Bu şekilde daha çok uğraşırsınız gibi görünüyor. Neyse; frmMüşteriEkle.Designer.cs dosyasını açın altı kırmızı çizgili satırları silin.
Mouse ile çift tıklayarak eklediğiniz event temsilcilerini kod tarafından silmeyin, silecekseniz tasarım penceresinde Properties panelinde event'i bulup sağ tıklayıp Reset e basın.
Event ve delegate konularını ve partial class konusunu inceleyin.
e-mail: onay[nokta]yalciner[at]hotmail[nokta]com
- Düzenleyen Önay YALÇINER 25 Ağustos 2020 Salı 12:34