Hello Arpit,
The code behind in your case will look something like
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["eid"] != null)
{
if (!Page.IsPostBack)
{
SqlConnection sqlCon;
SqlCommand sqlCmd;
SqlDataReader sqlRdr;
sqlCon = new SqlConnection();
sqlCon.ConnectionString = ConfigurationManager.ConnectionStrings["YOURDB"].ConnectionString;
sqlCmd = new SqlCommand();
sqlCmd.CommandText = "SELECT * FROM tbl_catinfo WHERE cat_id = @cat_id";
sqlCmd.Parameters.Add("@cat_id", Request.QueryString["eid"]);
sqlCmd.Connection = sqlCon;
sqlCmd.Connection.Open();
sqlRdr = sqlCmd.ExecuteReader(CommandBehavior.CloseConnection);
GridView1.DataSource = sqlRdr;
GridView1.DataBind();
sqlCmd.Dispose();
sqlCon.Dispose();
}
}
}
Regards,