Mini Shell

Direktori : C:/Inetpub/vhosts/protarte.com/httpdocs/admin/
Upload File :
Current File : C:/Inetpub/vhosts/protarte.com/httpdocs/admin/eliminar.aspx.cs

using System;
using System.Threading;
using System.Web.UI;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections;
using System.Configuration;
using System.IO;
using System.Drawing.Imaging;

public partial class admin_eliminar : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["protarteConnectionString"].ConnectionString);
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void bt_Click(object sender, EventArgs e)
    {
        string id = Request.QueryString["id"];
       

        SqlCommand delete = new SqlCommand();
        delete.CommandText = "delete from produto where id_pro=" + id;
        delete.Connection = con;
        delete.CommandType = CommandType.Text;

        con.Open();
        int numero_registos_eliminados = delete.ExecuteNonQuery();
        con.Close();

        if (numero_registos_eliminados == 1)
        {

            Response.Redirect("editar1.aspx");

        }
    }
    protected void bt2_Click(object sender, EventArgs e)
    {
        Response.Redirect("editar1.aspx");
    }
}

Zerion Mini Shell 1.0