Hi,
I want to create Gallerypage and in that the images must display like an album as in facebook.The Images must be in one album depending upon the Galleryname,they r coming from the database.
The database contains the fields:Gid(autogenerated),Gname,Imagepath.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
Width="400px" AllowPaging="True" Height="147px" BackColor="#CCCCCC" ForeColor="Black" BorderColor="" BorderStyle="Solid" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="2" CssClass="regularfont2">
<Columns>
<%--<asp:BoundField DataField="gallery_id" HeaderText="Gallery ID" />--%>
<asp:BoundField DataField="gname" HeaderText=" Name" />
<asp:ImageField DataImageUrlField="image_path" HeaderText="Images">
<ControlStyle Height="100px" Width="100px" />
</asp:ImageField>
</Columns>
</asp:GridView>code behind:protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getimages();
}
}
public void getimages()
{
SqlConnection con = new SqlConnection("user id=sa;password=admin;Data Source=SRV-DC;database=Exces");
con.Open();
SqlCommand sqlcmd = new SqlCommand();
sqlcmd.CommandType = CommandType.StoredProcedure;
sqlcmd.CommandText = "sp_getgalleryimages";
sqlcmd.Connection = con;
SqlDataAdapter da = new SqlDataAdapter(sqlcmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}[code]Technology:asp.net2.0 using c#.
IDE:VS2005 By,
Sasikala.