protected void GalleryView_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Select")
{
int id = Convert.ToInt32(e.CommandArgument);
Session["Sno"] = id.ToString();
SqlCommand cmd = new SqlCommand("Select TitleService from RW_Gallerys where Sno='" + id.ToString() + "'", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read() == true)
{
Session["TitleService"] = dr[0].ToString();
}
dr.Close();
SqlDataAdapter da = new SqlDataAdapter("select ImageServices from RW_GallerysImage where Sno='" + id.ToString() + "'", con);
DataSet ds = new DataSet();
da.Fill(ds, "RW_Gallerys");
GalleryList.DataSource = ds.Tables[0];
GalleryList.DataBind();
panel1.Visible = false;
panel2.Visible = true;
AddImages.Visible = true;
}
}
{
if (e.CommandName == "Select")
{
int id = Convert.ToInt32(e.CommandArgument);
Session["Sno"] = id.ToString();
SqlCommand cmd = new SqlCommand("Select TitleService from RW_Gallerys where Sno='" + id.ToString() + "'", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read() == true)
{
Session["TitleService"] = dr[0].ToString();
}
dr.Close();
SqlDataAdapter da = new SqlDataAdapter("select ImageServices from RW_GallerysImage where Sno='" + id.ToString() + "'", con);
DataSet ds = new DataSet();
da.Fill(ds, "RW_Gallerys");
GalleryList.DataSource = ds.Tables[0];
GalleryList.DataBind();
panel1.Visible = false;
panel2.Visible = true;
AddImages.Visible = true;
}
}
No comments:
Post a Comment