protected void Page_Load(object sender, EventArgs e) { DataTable table = new DataTable(); if (Request.QueryString["ProductId"] == null ) return; string ProductId = Request.QueryString["ProductId"]; Session["Id"] = Request.QueryString["ProductId"]; using (SqlConnection conn = new SqlConnection(connStr)) { using (SqlCommand cmd = new SqlCommand("SELECT * FROM BookDetails WHERE ProductId = @ProductId", conn)) { cmd.Parameters.Add(new SqlParameter("@ProductId", ProductId)); using (SqlDataAdapter ad = new SqlDataAdapter(cmd)) { ad.Fill(table); } } } listview1.DataSource = table; listview1.DataBind(); }
ER sandeep chourasia sandeepchrs@yahoo.com (on facebook) http://www.aspnetcodes.com/
Login to post response