Total members 11894 |It is currently Sat Nov 23, 2024 9:02 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi,

Quote:
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.




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Displaying Images in a Gallery
 Displaying Images using servlets     -  
 Displaying images from database instead of the url from data     -  
 PHP forum- images displaying as codes     -  
 images,videos and signatures displaying as codes     -  
 Sequence of Images , draw several images in a row     -  
 displaying double quotes in ASP     -  
 displaying alert box in html     -  
 ASP.NET code for filling and displaying a DataGrid     -  
 calling method to form- displaying textbox data in messagbox     -  
 bmiles v1.0 - images are not showing     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com