Code To DELETE in access Db using c# // SQL Server Management Studio

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

namespace DELETE_DY
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
            SqlConnection n = new SqlConnection();

            n.ConnectionString = "Data Source=LENOVO-PC;Initial Catalog=DicleYilmaz;Integrated Security=True";

            n.Open();

            SqlCommand d = new SqlCommand();
            d.Connection = n;

            d.CommandText = "DELETE FROM Personel where AD=@AD";
            d.CommandType = CommandType.Text;

            d.Parameters.AddWithValue("@AD", textBox1.Text);
            d.ExecuteNonQuery();
       

        }
    }
}

Yorumlar

Popüler Yayınlar