erkan67
Hectopat
- Katılım
- 24 Haziran 2019
- Mesajlar
- 419
- Çözümler
- 4
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.SqlTypes;
namespace DisOtomasyonu.
{
public partial class HastaKayit : Form.
{
public HastaKayit()
{
InitializeComponent();
}
public void verilisteleme()
{
string baglantiCumlesi = "Data Source=DESKTOP-DS8UMPK; initial catalog = hasta_veri;Integrated Security = True";
SqlConnection baglanti = new SqlConnection(baglantiCumlesi);
baglanti.Open();
SqlCommand komut = new SqlCommand("select * from hastaListesi", baglanti);
SqlDataReader veriokuyucu = komut.ExecuteReader();
DataTable tablo = new DataTable();
tablo.Load(veriokuyucu);
dataGridView1.DataSource = tablo;
baglanti.Close();
}
private void kaydet_Click(object sender, EventArgs e)
{
string baglantiCumlesi = "Data Source=DESKTOP-DS8UMPK; initial catalog = hasta_veri;Integrated Security = True";
SqlConnection baglanti = new.
SqlConnection(baglantiCumlesi);
baglanti.Open();
SqlCommand komut = new SqlCommand("insert intohastalistesi(ad, soyad, rahatsizlik,tckimlik, ) values(@ad, @soyad, @rahatsizlik, @tckimlik,)", baglanti);
komut.Parameters.AddWithValue("@ad", ADI.Text);
komut.Parameters.AddWithValue("@soyad", SOYADI.Text);
komut.Parameters.AddWithValue("@tckimlik", KIMLIK.Text);
komut.Parameters.AddWithValue("@rahatsizlik", RAHATSIZLIK.Text);
komut.ExecuteNonQuery();
MessageBox.Show("Hasta Kayit Edildi");
baglanti.Close();
verilisteleme();
}
private void HastaKayit_Load(object sender, EventArgs e)
{
verilisteleme();
}
}
}
Bu hatayi nasıl cözebilirim? Simdiden teşekkürler.