protected void Save(object sender, EventArgs e) { string con = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; using (SqlConnection Conn = new SqlConnection(con)) { SqlCommand cmd = new SqlCommand("dbo.AddArticles", Conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Cat_ID", DropDownList_categories.SelectedValue); cmd.Parameters.AddWithValue("@Art_Title", txt_NAME.Text); cmd.Parameters.AddWithValue("@Description", txt_DESC.Text); Conn.Open(); cmd.ExecuteNonQuery(); Conn.Close(); } txt_NAME.Text = ""; DropDownList_categories.DataBind(); txt_DESC.Text = ""; }
protected void Restore(object sender, EventArgs e) { txt_NAME.Text = ""; DropDownList_categories.DataBind(); txt_DESC.Text = ""; }