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>