I dont understand what im doing wrong!

public partial class Delete : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        SqlCommand comm = new SqlCommand("Delete into [Staff] (Staff_Number, Login_Password, Phone_Num) VALUES (@Staff_Number, @Login_Password, @Phone_Num)", conn);

        comm.Parameters.Remove("@Staff_Number", SqlDbType.VarChar);
        comm.Parameters.Remove("@Login_Password", SqlDbType.VarChar);
        comm.Parameters.Remove("@Phone_Num", SqlDbType.VarChar);


        comm.Parameters["@Staff_Number"].Value = txtStaff.Text;
        comm.Parameters["@Login_Password"].Value = txtPassword.Text;
        comm.Parameters["@Phone_Num"].Value = txtContact.Text;

        conn.Open();
        comm.ExecuteNonQuery();
        conn.Close();
    }
    protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
    {

    }
    protected void ImageButton4_Click(object sender, ImageClickEventArgs e)
    {

    }

   

}

Check syntax of delete statement.

protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        SqlCommand comm = new SqlCommand("Delete From [Staff]  Where Staff_number=@Staff_Number", conn);

        comm.Parameters.AddWithValue("@Staff_Number",txtStaff.Text);
        conn.Open();
        comm.ExecuteNonQuery();
        conn.Close();
    }

DELETE from [Staff]

However id recommend using stored procedures. Much faster, safer and efficient!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.