I want to hide/delete a specific row from gridview when user clicks a button. The gridview should not display the hidden/deleted row even if the page is refreshed or loaded for the second time. The data deleted on the gridview should not affect the database.
My Aspx Code:
Approve or Reject Subjects
Course:
CommandName="Select"/>
My Code Behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Text.RegularExpressions;
using System.Data;
using System.Configuration;
namespace Subject_Registration_System_for_IUMW
{
public partial class Approve_or_Reject : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=User-PC\\User;Initial Catalog=Subject Registration System;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
if (Session["username"] != null)
{
Label1.Text = Session["username"].ToString();
}
con.Open();
SqlCommand cmd = new SqlCommand("SELECT Course FROM Subjects", con);
DDL1.DataSource = cmd.ExecuteReader();
DDL1.DataValueField = "Course";
DDL1.DataTextField = "Course";
DDL1.DataBind();
con.Close();
}
}
}
Please help me
Thank you
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Azm AmnPosted Feb 23, 2017, 10:09 PM
Joginder BangerPosted Feb 23, 2017, 10:23 AM
Azm AmnPosted Feb 23, 2017, 7:49 AM
Suvendu Shekhar Giri
Suvendu Shekhar GiriPosted Feb 23, 2017, 7:38 AM