B
Bjorn Sagbakken
This is kind of silly, but I just cannot figure out why:
In ASP.NET 2.0 I am retrieving images from a MS SQL server, and writing them
as binary to a separate page as the url for image controls, everything by
the book. I have been doing this a lot with VB. Now I am writing a new
application in C#, and the strange thng is this:
- it works well in debug mode
- but not on the published folder on the same server (localhost) - image
frames all have a cross in them
- a VB coded Image.aspx works well also on the published folder
Her is the C# code in the Image.aspx file::
.....som init code...
SqlConnection con = new SqlConnection(init.con());
con.Open();
string strSQL = "SELECT img FROM photo where ID= " + ID;
SqlCommand cmd = new SqlCommand(strSQL, con);
imagebyte = (byte[])cmd.ExecuteScalar();
con.Close();
Response.Clear();
Response.ContentType = "image/jpeg";
Response.BinaryWrite(imagebyte);
Response.BufferOutput= true;
--> Why does this work in debug mode, and not on the published folder?
Bjorn
In ASP.NET 2.0 I am retrieving images from a MS SQL server, and writing them
as binary to a separate page as the url for image controls, everything by
the book. I have been doing this a lot with VB. Now I am writing a new
application in C#, and the strange thng is this:
- it works well in debug mode
- but not on the published folder on the same server (localhost) - image
frames all have a cross in them
- a VB coded Image.aspx works well also on the published folder
Her is the C# code in the Image.aspx file::
.....som init code...
SqlConnection con = new SqlConnection(init.con());
con.Open();
string strSQL = "SELECT img FROM photo where ID= " + ID;
SqlCommand cmd = new SqlCommand(strSQL, con);
imagebyte = (byte[])cmd.ExecuteScalar();
con.Close();
Response.Clear();
Response.ContentType = "image/jpeg";
Response.BinaryWrite(imagebyte);
Response.BufferOutput= true;
--> Why does this work in debug mode, and not on the published folder?
Bjorn