retreiving Images From Database with image datatype pbm
-
I have a database with some fields,along with this fields an image field with datatype image is tehre.But after saving all details into the db.the saved data will be displayed on a grid.But whn i tried to retrieve the data by selecting into a grid row the text fields are coming properly.But the image will be displayed only the first photo that i uploded.Only one image will be displayed for all the rows.What is the reason I attach the image retreival code in the rowcommand of the grid. DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString(); The Getnit() is to retriving data from the table..
-
I have a database with some fields,along with this fields an image field with datatype image is tehre.But after saving all details into the db.the saved data will be displayed on a grid.But whn i tried to retrieve the data by selecting into a grid row the text fields are coming properly.But the image will be displayed only the first photo that i uploded.Only one image will be displayed for all the rows.What is the reason I attach the image retreival code in the rowcommand of the grid. DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString(); The Getnit() is to retriving data from the table..
Hey you hav to use for loop for this.. Try this.......... DataTable dt = new DataTable(); dt = insunit.GetUnit(id); for(int i=0; i< dt.row.count; i++) { Img_Logo.ImageUrl = d.Rows[i]["UnitLogoPath"].ToString(); } it will be work... Bye Bye. Nisar Inamdar.:rose: Always For U
-
I have a database with some fields,along with this fields an image field with datatype image is tehre.But after saving all details into the db.the saved data will be displayed on a grid.But whn i tried to retrieve the data by selecting into a grid row the text fields are coming properly.But the image will be displayed only the first photo that i uploded.Only one image will be displayed for all the rows.What is the reason I attach the image retreival code in the rowcommand of the grid. DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString(); The Getnit() is to retriving data from the table..
SreejithAchutan wrote:
DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString();
Hey what you have done here ?? Can you try to figure out ?
DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.**Rows[0]**["UnitLogoPath"].ToString();
Here you are taking only first rows value... :) Change it.. If possible bind data in RowDataBound Event of gridview. On every row find appropriate data and bind it properly.Thanks, Sun Rays To get something you must have to try once. My Articles
-
Hey you hav to use for loop for this.. Try this.......... DataTable dt = new DataTable(); dt = insunit.GetUnit(id); for(int i=0; i< dt.row.count; i++) { Img_Logo.ImageUrl = d.Rows[i]["UnitLogoPath"].ToString(); } it will be work... Bye Bye. Nisar Inamdar.:rose: Always For U
Thanks for ur reply .... But the pbm occurs in saving the image.All images in the db are same.How this happens.
-
SreejithAchutan wrote:
DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString();
Hey what you have done here ?? Can you try to figure out ?
DataTable dt = new DataTable(); dt = insunit.GetUnit(id); Img_Logo.ImageUrl = d.**Rows[0]**["UnitLogoPath"].ToString();
Here you are taking only first rows value... :) Change it.. If possible bind data in RowDataBound Event of gridview. On every row find appropriate data and bind it properly.Thanks, Sun Rays To get something you must have to try once. My Articles
The pbm occurs is not in the rows.But the image saved is same in the db.Why the image saved is same in the db....