using System; using System.Collections.Generic; using System.Configuration; using System.Data.SqlClient; using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Newdelhibarassocia { public partial class Photo : System.Web.UI.Page { Class1 obj = new Class1(); // SqlConnection connect = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"].ToString()); // SqlCommand cmd; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["AlbumId"] != null) { string AlbumId = Request.QueryString["AlbumId"].ToString(); Repeater1Bind(AlbumId); } else { Response.Redirect("~/Photo-Gallery.aspx"); } } } private void Repeater1Bind(string AlbumId) { string qrajneeti = "select t1.pkid,t1.Name,replace(t1.ImagePath, '~/', '') as ImagePath,t1.ImageRank,t1.About,t2.pkid as AlbumId,t2.AlbumName from [newdelhibar_imageGalleryList] t1 inner join [newdelhibar_PhotoAlbumList] t2 on t1.Album=t2.pkid where t2.pkid='" + AlbumId + "' order by cast(t1.ImageRank as int)"; DataSet dsrajneeti = obj.ReturnDataSet(qrajneeti); if (dsrajneeti != null && dsrajneeti.Tables[0].Rows.Count > 0) { lblAlbumName.Text = " of " + dsrajneeti.Tables[0].Rows[0]["AlbumName"]; Repeater1.DataSource = dsrajneeti; Repeater1.DataBind(); //for (int i = 0; i < dsrajneeti.Tables[0].Rows.Count; i++) //{ // photo="
  • "+dsrajneeti.Tables[0].Rows[i][4].ToString()+"
  • "; // photo1 = photo1 + photo; //} //Literal1.Text = photo1; } } } }