Urgent question on displaying Binary IMAGE data to a Datagrid in C# ASP.NET
-
Hi, I have a VERY URGENT question on C# in ASP.NET. I am building an ASP.NET WEB application. Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control? I can manage to retreive the Binary Data, but I have absolutely no idea how it can be placed into the dataset, or accessed via the Databinder. I can only display regular string data onto a Datagrid Control. This is my method in displaying string data onto a Datagrid: 1. From the Codebehind, I connect to the database. 2. I then use a DATASET and store the retreived data 3. In the HTML page, I use the Databinder to load the data (<%# DataBinder.Eval(Container.DataItem,"NAMEOFDATABASECOLUMN") %> However this method only works for strings, I need to display Binary Image, can anyone help me? Thank you!!!
-
Hi, I have a VERY URGENT question on C# in ASP.NET. I am building an ASP.NET WEB application. Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control? I can manage to retreive the Binary Data, but I have absolutely no idea how it can be placed into the dataset, or accessed via the Databinder. I can only display regular string data onto a Datagrid Control. This is my method in displaying string data onto a Datagrid: 1. From the Codebehind, I connect to the database. 2. I then use a DATASET and store the retreived data 3. In the HTML page, I use the Databinder to load the data (<%# DataBinder.Eval(Container.DataItem,"NAMEOFDATABASECOLUMN") %> However this method only works for strings, I need to display Binary Image, can anyone help me? Thank you!!!
Infernojericho wrote:
I have a VERY URGENT question
So, totally different from all the others ?
Infernojericho wrote:
Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control?
Yes, you need to write a http handler, and have your images link through that. your problem is that an img tag requires a link to the image itself. So, you need to write a http handler that returns that image data, and then your databinding creates the link that that page, with an id that is used to seperately download the image. This means a lot of database hits, a better bet for a high load site is to put the images on your file system and store the path to them in yuor database.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Infernojericho wrote:
I have a VERY URGENT question
So, totally different from all the others ?
Infernojericho wrote:
Does anyone know how to retreive BINARY image from a SQL Server 2005 Express Database and DISPLAY it on a Datagrid control?
Yes, you need to write a http handler, and have your images link through that. your problem is that an img tag requires a link to the image itself. So, you need to write a http handler that returns that image data, and then your databinding creates the link that that page, with an id that is used to seperately download the image. This means a lot of database hits, a better bet for a high load site is to put the images on your file system and store the path to them in yuor database.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi Christian, thanks for your reply (again). I am afraid I am not very good in ASP.NET (I think you can tell that already), and I am quite lost. Do you happen to know any sites on the web with similar examples? Many thanks again.
-
Hi Christian, thanks for your reply (again). I am afraid I am not very good in ASP.NET (I think you can tell that already), and I am quite lost. Do you happen to know any sites on the web with similar examples? Many thanks again.
I think this[^] does what I mean.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I think this[^] does what I mean.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Thanks, Christian. Greatly appreciated. I'll take a look at it right now.
-
I think this[^] does what I mean.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
That would mean that you can't use the project provided, but the overall concept will be the same.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
That would mean that you can't use the project provided, but the overall concept will be the same.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Alright, many thanks again for the assist.