Help with reading binary data (photos) using Oledb [modified]
-
Hi there. I am currently working on a website assignment and I need some desperate help. I am using SQL Server 2005 Express Edition to store my data. I am using C# to write my site. I have used the OleDb to connect to the database, and to write and read the values. I have stored binary data (photo, jpeg) via Oledb, there is no problems at all. However I am stuck big time with retreiving photos. I am also using OleDb to connect to the database, then I placed the retreived data into a Dataset. I was able to retreive other information (such as name, phone numbers) from the dataset. However I am unable to retreive the binary data from the dataset. I've searched the web, it seemed everyone is using SQLDataReader, so I was curious it is possible to retreive binary data using OleDb at all? HELP! Any feedback would be appreciated, thanks!
modified on Monday, March 3, 2008 12:15 AM
-
Hi there. I am currently working on a website assignment and I need some desperate help. I am using SQL Server 2005 Express Edition to store my data. I am using C# to write my site. I have used the OleDb to connect to the database, and to write and read the values. I have stored binary data (photo, jpeg) via Oledb, there is no problems at all. However I am stuck big time with retreiving photos. I am also using OleDb to connect to the database, then I placed the retreived data into a Dataset. I was able to retreive other information (such as name, phone numbers) from the dataset. However I am unable to retreive the binary data from the dataset. I've searched the web, it seemed everyone is using SQLDataReader, so I was curious it is possible to retreive binary data using OleDb at all? HELP! Any feedback would be appreciated, thanks!
modified on Monday, March 3, 2008 12:15 AM
Infernojericho wrote:
I have used the OleDb to connect to the database, and to write and read the values.
Why have you not used the SQL Server specific classes built in to .NET ? What have you tried to access your data ? If a datatable has a limit to how big a column can be, perhaps you have to use a datareader to get that byte stream out ?
Christian Graus - Microsoft MVP - C++ "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 )