Total members 10259 | Gratitudes |It is currently Mon May 21, 2012 2:39 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Question
 Question subject: Displaying Images in a Gallery
PostPosted: Wed Feb 11, 2009 12:11 pm 
Offline
Newbie
User avatar

Joined: Wed Feb 11, 2009 11:31 am
Posts: 1
Has thanked: 0 time
Have thanks: 0 time

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.


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 displaying double quotes in ASP
 upload and download images in my jsp page.
 Exporting Images in Excel in Android
 negative margins with images
 displaying alert box in html
 aligning the scanned images
 How to delete/remove images from excel 2007 using POI.
 images,videos and signatures displaying as codes
 PHP forum- images displaying as codes
 calling method to form- displaying textbox data in messagbox

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team