473,805 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outputting MSSQL 2000 Image DataType??

Ok this seemed like a simple task im programming in c# .NET
the problem comes when i try to print a image back out of thedatabase to the browser.

Here is my code:

Response.Conten tType = "image/jpeg";
DataSet DS = new DataSet();

// MSSQL Connection
SqlConnection sqlConn = new SqlConnection(" SERVER=" +ConfigurationS ettings.AppSett ings["dbSource"].ToString() +";UID=" +ConfigurationS ettings.AppSett ings["dbUserName "].ToString() +";PWD=" +ConfigurationS ettings.AppSett ings["dbPassword "].ToString() +";DATABASE= " +ConfigurationS ettings.AppSett ings["dbDatabase "].ToString());
// [ProductType] Data Set
SqlDataAdapter sqlDataAdapt = new SqlDataAdapter( "SELECT SourceFROM ImageMatrix WHERE GUID = '" + GUID + "'", sqlConn);
sqlDataAdapt.Fi ll(DS, "Image");
DataTable CurrentTable = DS.Tables[0];

if (CurrentTable.R ows.Count != 0)
{
Response.Binary Write((byte[])CurrentTable.R ows[0]["Source"]);
}

Ok yet again the code looks simple enough YET it doesnt work allthat gets printed out to the browser is System.Byte[] its reallyannoying does anyone know why its printing the textSystem.Byte[] vrs the actual image??

Thanks!!

--------------------------------
From: TJ Meadows

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>z9JzpbTrYEe oDQWR2n1vRQ==</Id>
Nov 18 '05 #1
0 968

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4398
by: badz | last post by:
Hi frenz Lately I try to use MSSQL and PHP , the problem arise when PHP try to read MSSQL field with 'image' data type, header("Content-type: image/jpeg"); // act as a jpg file to browser I try to used normal working file that store BLOB as file type in MSSQL ...but still not working. Is it because the image data type in MSSQL can not be recognise by PHP?
3
7156
by: steve | last post by:
Hi, I'd like to round all amounts in a certain column to 2 decimals. I tried the following query, but eventhough the syntax is correct, it doesn't give any result: update gbkmut set bdr_hfl = round(bdr_hfl,2) can anyone help me?
8
14024
by: Yusuf INCEKARA | last post by:
I have a stored procedure : CREATE PROCEDURE STP_GETSTORELIST @RETCUR CURSOR VARYING OUTPUT AS set @RETCUR = CURSOR FORWARD_ONLY STATIC FOR SELECT ID,STORE_NAME FROM T_INF_STORE ORDER BY STORE_NAME OPEN @RETCUR
3
4332
by: gharmel | last post by:
I'm trying to get some clues on why I get (much) slower responses from my PHP applications when dealing with a remote sql server as opposed to a local sql server. Here's my situation: Server #1 MSSQL 2000 sp4 Windows 2000 Server PHP4 on IIS5 (CGI)
0
1449
by: Derftics | last post by:
Hi Guys, Is there anyone who have tried installing MSSQL 2000 and MSSQL 2005 servers in one desktop computer? I have tried using MSDE and successfully install the MSSQL 2000 server but when I tried installing MSSQL 2005, it allows only the client tools. I have revert the process and successfully install MSSQL 2005 server but now the MSDE was prompting me an error. Is possible to install both versions of MSSQL servers in one desktop...
4
10519
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it doesn't seem to write to the screen in the way I would expect. The output is:
3
1978
by: Leong | last post by:
Do you know how to write a code to retrieve the image (DataType) in the mssql? The image file is save in the desktop application, and now i need to do a web to display a image from mssql. Did anyone know that? TQ
0
1772
by: hassanali20 | last post by:
I've surfed this forum and found one thread which was talking about the same problem i've, but it didn't help in my situation. http://www.thescripts.com/forum/thread510563.html I could connect to MSSQL server using freetds 8.0 and able to run queries to MSSQL server, but the query doesn't fetch anything when it runs on a column having datatype as VARCHAR having special character as in <méxico> (note the second character) the acute accent. ...
0
1107
by: pickforc | last post by:
I'm relatively new to MSSQL and finding it difficult to find information on how to search for datatypes. I have several MSSQL DB's I'm using as datasources for reporting and need to find out which are using the timestamp Datatype. Does anyone know how I can search all DB's simultaneously retrieving information about which contain the timestamp Datatype and it's location?
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.