HaberID mizi gireceğimiz form alanı. Default.aspx sayfamız. Kod: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>ASP.Net ve MS Access Veri Tabanından Kayıt Silme</title> </head> <body> <form id="form1" runat="server"> <div> Silmek İstediğiniz Haber No Girin: <asp:TextBox ID="txt_haberid" runat="server"></asp:TextBox> <br /> <asp:Button ID="btn_sil" runat="server" OnClick="btn_sil_Click" Text="SİL" BackColor="#FFFFC0" BorderColor="#FFE0C0" BorderStyle="Outset" Width="66px" /></div> </form> </body> </html> CodeBehind alanımız veri tabanımıza bağlandığımız alan. Default.aspx.cs sayfamız. Kod: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; public partial class Default : System.Web.UI.Page { protected void btn_sil_Click(object sender, EventArgs e) { OleDbConnection connUTFIE = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" + Server.MapPath("~/App_Data\\sanalkurs.mdb")); //Veri tabanımızın fiziksel yolunu belirledik, OleDbCommand Sil = new OleDbCommand("Delete Haber.* from Haber where HaberID=@HaberID", connUTFIE); Sil.Parameters.Add("@HaberID", OleDbType.Variant).Value = txt_haberid.Text; if (connUTFIE.State == ConnectionState.Closed) { connUTFIE.Open(); } Sil.ExecuteNonQuery(); //Girdiğimiz HaberID ile ilgili haberin bilgileri silinmiş oldu. } }