What's Web Control - Jquery Should Be Used To Display Images From Database
Mar 21, 2011
I want to create a product sale page. The sale page will have images of products generated from sql server database with their price and name. When a user clicks on a specific image, it should navigate to another page with more images and details of that particular product. I just dunno which control to use to display images on the sale page. Also the admin can add products with images, therfore when they add new product , that product should come the first on the sale page. I can acheive that just by writing a simple query , but i dont know what should i use to display images. I cant use image buttons coz the images can be more than 50 depends, nor i can use grid view for images. I am using asp.net and sql server 2008.
i want to display the image either from a database or through file upload control but in case of database i had seen your article but what binary data i can store as you had in data column table and when i save a file somewhere through file upload but it is not displaying the image.
I have two columns in database name of the image(varchar) and image(BLOB) and i have inserted images into database.now i need to display on grid-view control. am banging my head since one day by searching and i have used handler but no use.
I am using jquery image slider on my website, what I want is to get the images from the sql server table, presently the images are included in the project , see below for the code:
i am creating a page that will display multiple images from the database. i can do it if i will only display one image, by using a page to be rendered as image. something like this...
using (SqlDataReader reader = comm.ExecuteReader()) { Byte[] images = new Byte[](); while (reader.Read()) { Response.BinaryWrite(images); } }
and in the aspx file i have: <asp:Image ID="imgPhoto" runat="server" ImageUrl="~/ShowImages/LoadImages.aspx" Height="100px" Width="100px" BorderWidth="1px" /> what i want to achieve is to display multiple images from the database without making a page to be rendered as image...
Is there anyway of handling images from database to jquery image swapper or any other type of image swapper. the images should be populated depending on the number of images generated from the databse. I can get all the images from the databse but I cant find a way to show those images on the jquery image swapper. I can display all the images by using datalist but with data list i cant use the jquery image swapper.
protected void showDetails(int makeID) { conn.Open(); SqlCommand cmd = new SqlCommand("Select Price,image,make from productDetail Where (makeID LIKE @makeID)" , conn); SqlParameter param = new SqlParameter(); param.ParameterName = "@makeID";
Here's my situation. I have a table called Inspections, and another table called Images. The Images table takes the ID of the Inspections table as a foreign key, so the Images tables contains multiple images with the same foreign key value.I'd like to be able to enter an integer of the ID number from the Inspections table and have it return all the records from the Images table with the foreign key that matches this ID, and then load them into a gridview. When I tried using the .ashx Handler approach that I found at this link
I'am Developing a commercial website using vs2005 and sql 2005,where my users will download and upload wallpapers and ringtones,so my issue is,i got the coding for uploading ,ut the problem is it is storing the files two times, the code i have used is in the following link,http://www.beansoftware.com/asp.net-tutorials/images-database.aspx
How to display images in crystal report from database am inserting address (image folder) of images into the database, not inserting images into the database...
i have encountered a problem on how to load the database images to be display in the Image content in the web pages. I am currently using an Access database with a table "Images" and there are 4 columns in it. "ImageID", "ImageDescription","ImageofPicture","Description". Below is my code: Words highlighted in bold is where the problem occurs. No image is display in the Image box but theres a red cross at the top left. Image description is displaying fine in the textboxes
int MaxRows = 0; int inc = 0; int inc1 = 1; int inc2 = 2; int inc3 = 3; System.Data.OleDb.OleDbConnection cs; System.Data.OleDb.OleDbDataAdapter dta; DataSet ds1; byte[] photo_array; protected void Page_Load(object sender, EventArgs e) { cs = new System.Data.OleDb.OleDbConnection(); //tell the program where the database is located cs.ConnectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Users\Admin\Desktop\Website1\App_Data\Database.mdb"; ds1 = new DataSet(); string sql = "SELECT * From Images ORDER BY ImageDescription ASC"; dta = new System.Data.OleDb.OleDbDataAdapter(sql, cs); cs.Open(); dta.Fill(ds1, "Images"); Navigation(); //MaxRows equals to the total amount of records from the database MaxRows = ds1.Tables["Images"].Rows.Count; } private void Navigation() { //get the first records from the database DataRow dtaRow = ds1.Tables["Images"].Rows[inc]; //get column values in the row TextBox3.Text = dtaRow.ItemArray.GetValue(1).ToString(); TextBox7.Text = dtaRow.ItemArray.GetValue(3).ToString(); DataRow dtaRow1 = ds1.Tables["Images"].Rows[inc1]; TextBox4.Text = dtaRow1.ItemArray.GetValue(1).ToString(); TextBox2.Text = dtaRow1.ItemArray.GetValue(3).ToString(); DataRow dtaRow2 = ds1.Tables["Images"].Rows[inc2]; TextBox5.Text = dtaRow2.ItemArray.GetValue(1).ToString(); TextBox8.Text = dtaRow2.ItemArray.GetValue(3).ToString(); DataRow dtaRow3 = ds1.Tables["Images"].Rows[inc3]; TextBox6.Text = dtaRow3.ItemArray.GetValue(1).ToString(); TextBox9.Text = dtaRow3.ItemArray.GetValue(3).ToString(); //if 3rd column value is not null if (ds1.Tables[0].Rows[inc][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox3.Text; } if (ds1.Tables[0].Rows[inc1][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox4.Text; } if (ds1.Tables[0].Rows[inc2][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox5.Text; } if (ds1.Tables[0].Rows[inc3][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox6.Text; } } } Code for ImageHandler.ashx: using System; using System.Web; using System.Data.OleDb; public class ImageHandler : IHttpHandler { public void ProcessRequest (HttpContext context) { string qry = "SELECT ImageofPicture FROM Images WHERE ImageDescription = ?"; string connect = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Users\Admin\Desktop\Website1\App_Data\Database.mdb"; using (OleDbConnection conn = new OleDbConnection(connect)) { if (context.Request.QueryString["id"] != null) { OleDbCommand cmd = new OleDbCommand(qry, conn); cmd.Parameters.AddWithValue("", context.Request.QueryString["id"]); conn.Open(); using (OleDbDataReader rdr = cmd.ExecuteReader()) { if (rdr.HasRows) { rdr.Read(); context.Response.ContentType = "image/jpeg"; context.Response.BinaryWrite((byte[])rdr["ImageofPicture"]); } } } } } public bool IsReusable { get { return false; }
If in one form upload image form we enter ID in textbox againts ID label and upload an image file using fileuploadcontrol when we click on upload button image save in DB and in next form view image when we enter ID in textbox againts label enter ID. Images show in GRIDVIEW having columns (ID,images) ...
I want to know that how to dispay the all images from the folder available on ftp to the web page.
Ex :
There are 5 folder are available on FTP site. If I want to access the folder A with all images. How it it possible ? The Image should display on slider.
I have a web site application using FW 3.5 and I have the following problem: In one of my forms when I click a listview an image control displays the image that corresponds to a directory, something like this:
Is this the only way? I have tried this with a couple of photos, but I cant put them all in C: drive (where the wwroot is located) because there is no space available, I really need to read those images from the D: drive.
my problem i have defined style sheet for menu and built a user control which was placed in Control folder, but images are not displayed in the menu when the run the product/sart.aspx, but they appear in Default.aspx