Convert VB to C# for saving/reading an image from Access DB

G

Guest

Hi,

I am trying to save and read an image from MS Access DB based on the
following article:

http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

Right now, I saved images without any errors. After reading the ole object
from db, I saved it to C: as file1.bmp and displayed on the web. But it can
not be displayed. After I manually sent the file to wordpad, it shows

System.Byte [ ]

Now I suspect my saving an image might be wrong. The table has 2 columns:
username and userfile. Userfile column shows

..ong binary data

I can not find a way to verify if data was saved ok? But saving does not
report any errors. I am attached my saving and reading codes here to see if
anyone can help?

THanks. –dale
private void btnSaveToDB_Click(object sender, System.EventArgs e)
{
if (dListUsers.SelectedValue == "")
{
lblFileAccess.Text = "You need to select an user first!";
return;
}
curFileName = myFile.PostedFile.FileName;
// only the attched file name not its path
string c = System.IO.Path.GetFileName(curFileName);
// Read a bitmap contents in a stream
FileStream fs = new FileStream(curFileName, FileMode.OpenOrCreate,
FileAccess.Read);
byte[] rawData = new byte[fs.Length];
fs.Read(rawData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
// Construct a SQL string and a connection object
OleDbConnection dbConn;
OleDbCommand dbCmd;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
string sSQL;

sSQL = ("INSERT INTO UserFiles (UserName,UserFile) "
+ ("VALUES ("
+ (dbClass.DelimString(dListUsers.SelectedValue) + (","
+ ("\'"+rawData + "\')")))));
try
{
// write the visit log entry
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sSQL, dbConn);
dbCmd.ExecuteNonQuery();
dbConn.Close();
lblFileAccess.Text = "The file has been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
lblFileAccess.Text = "The file has not been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
}

private void btnReadFmDB_Click(object sender, System.EventArgs e)
{
OleDbConnection dbConn;
OleDbCommand dbCmd;
OleDbDataReader dbDR;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
// Construct a SQL string and a connection object
string sql = "SELECT UserFile FROM UserFiles WHERE Username =\'"
+ dListUsers.SelectedValue + "\'";
FileStream fs;
BinaryWriter bw;
int bufferSize = 300000;
//byte[] outbyte;
byte[] outbyte = new byte[300000 - 1];

long retval;
//long startIndex = 0;
//string pub_id = "";

try
{
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sql, dbConn);
dbDR = dbCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dbDR.Read())
{
fs = new FileStream(savedImageName, FileMode.OpenOrCreate,
FileAccess.Write);
bw = new BinaryWriter(fs);
//startIndex = 0;
retval = dbDR.GetBytes(0, 0, outbyte, 0, bufferSize);

bw.Write(outbyte);
bw.Flush();
// Close the output file.
bw.Close();
fs.Close();
}
// get the end
dbConn.Close();
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
return;
}
// Display image
//curImage = System.Web.UI.WebControls.Image.FromFile(savedImageName);
imgBox.ImageUrl = savedImageName;

}
 
G

Guest

bitmaps stored in MS Access normally have a 78 byte OLE Header that you need
to strip off before saving the remaining bytes.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




dale zhang said:
Hi,

I am trying to save and read an image from MS Access DB based on the
following article:

http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

Right now, I saved images without any errors. After reading the ole object
from db, I saved it to C: as file1.bmp and displayed on the web. But it can
not be displayed. After I manually sent the file to wordpad, it shows

System.Byte [ ]

Now I suspect my saving an image might be wrong. The table has 2 columns:
username and userfile. Userfile column shows

.ong binary data

I can not find a way to verify if data was saved ok? But saving does not
report any errors. I am attached my saving and reading codes here to see if
anyone can help?

THanks. –dale
private void btnSaveToDB_Click(object sender, System.EventArgs e)
{
if (dListUsers.SelectedValue == "")
{
lblFileAccess.Text = "You need to select an user first!";
return;
}
curFileName = myFile.PostedFile.FileName;
// only the attched file name not its path
string c = System.IO.Path.GetFileName(curFileName);
// Read a bitmap contents in a stream
FileStream fs = new FileStream(curFileName, FileMode.OpenOrCreate,
FileAccess.Read);
byte[] rawData = new byte[fs.Length];
fs.Read(rawData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
// Construct a SQL string and a connection object
OleDbConnection dbConn;
OleDbCommand dbCmd;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
string sSQL;

sSQL = ("INSERT INTO UserFiles (UserName,UserFile) "
+ ("VALUES ("
+ (dbClass.DelimString(dListUsers.SelectedValue) + (","
+ ("\'"+rawData + "\')")))));
try
{
// write the visit log entry
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sSQL, dbConn);
dbCmd.ExecuteNonQuery();
dbConn.Close();
lblFileAccess.Text = "The file has been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
lblFileAccess.Text = "The file has not been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
}

private void btnReadFmDB_Click(object sender, System.EventArgs e)
{
OleDbConnection dbConn;
OleDbCommand dbCmd;
OleDbDataReader dbDR;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
// Construct a SQL string and a connection object
string sql = "SELECT UserFile FROM UserFiles WHERE Username =\'"
+ dListUsers.SelectedValue + "\'";
FileStream fs;
BinaryWriter bw;
int bufferSize = 300000;
//byte[] outbyte;
byte[] outbyte = new byte[300000 - 1];

long retval;
//long startIndex = 0;
//string pub_id = "";

try
{
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sql, dbConn);
dbDR = dbCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dbDR.Read())
{
fs = new FileStream(savedImageName, FileMode.OpenOrCreate,
FileAccess.Write);
bw = new BinaryWriter(fs);
//startIndex = 0;
retval = dbDR.GetBytes(0, 0, outbyte, 0, bufferSize);

bw.Write(outbyte);
bw.Flush();
// Close the output file.
bw.Close();
fs.Close();
}
// get the end
dbConn.Close();
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
return;
}
// Display image
//curImage = System.Web.UI.WebControls.Image.FromFile(savedImageName);
imgBox.ImageUrl = savedImageName;

}
 
G

Guest

Hi Peter,

Thank you providing this important info.

I changed my reading as below:

retval = dbDR.GetBytes(0, 78, outbyte, 0, bufferSize);

still can not display. When I opened the saved file in wordpad, I saw
nothing. Before I can see:

System.Byte [ ]

Did I do it wrongly?

-Dale
Peter Bromberg said:
bitmaps stored in MS Access normally have a 78 byte OLE Header that you need
to strip off before saving the remaining bytes.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




dale zhang said:
Hi,

I am trying to save and read an image from MS Access DB based on the
following article:

http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

Right now, I saved images without any errors. After reading the ole object
from db, I saved it to C: as file1.bmp and displayed on the web. But it can
not be displayed. After I manually sent the file to wordpad, it shows

System.Byte [ ]

Now I suspect my saving an image might be wrong. The table has 2 columns:
username and userfile. Userfile column shows

.ong binary data

I can not find a way to verify if data was saved ok? But saving does not
report any errors. I am attached my saving and reading codes here to see if
anyone can help?

THanks. –dale
private void btnSaveToDB_Click(object sender, System.EventArgs e)
{
if (dListUsers.SelectedValue == "")
{
lblFileAccess.Text = "You need to select an user first!";
return;
}
curFileName = myFile.PostedFile.FileName;
// only the attched file name not its path
string c = System.IO.Path.GetFileName(curFileName);
// Read a bitmap contents in a stream
FileStream fs = new FileStream(curFileName, FileMode.OpenOrCreate,
FileAccess.Read);
byte[] rawData = new byte[fs.Length];
fs.Read(rawData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
// Construct a SQL string and a connection object
OleDbConnection dbConn;
OleDbCommand dbCmd;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
string sSQL;

sSQL = ("INSERT INTO UserFiles (UserName,UserFile) "
+ ("VALUES ("
+ (dbClass.DelimString(dListUsers.SelectedValue) + (","
+ ("\'"+rawData + "\')")))));
try
{
// write the visit log entry
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sSQL, dbConn);
dbCmd.ExecuteNonQuery();
dbConn.Close();
lblFileAccess.Text = "The file has been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
lblFileAccess.Text = "The file has not been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
}

private void btnReadFmDB_Click(object sender, System.EventArgs e)
{
OleDbConnection dbConn;
OleDbCommand dbCmd;
OleDbDataReader dbDR;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
// Construct a SQL string and a connection object
string sql = "SELECT UserFile FROM UserFiles WHERE Username =\'"
+ dListUsers.SelectedValue + "\'";
FileStream fs;
BinaryWriter bw;
int bufferSize = 300000;
//byte[] outbyte;
byte[] outbyte = new byte[300000 - 1];

long retval;
//long startIndex = 0;
//string pub_id = "";

try
{
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sql, dbConn);
dbDR = dbCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dbDR.Read())
{
fs = new FileStream(savedImageName, FileMode.OpenOrCreate,
FileAccess.Write);
bw = new BinaryWriter(fs);
//startIndex = 0;
retval = dbDR.GetBytes(0, 0, outbyte, 0, bufferSize);

bw.Write(outbyte);
bw.Flush();
// Close the output file.
bw.Close();
fs.Close();
}
// get the end
dbConn.Close();
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
return;
}
// Display image
//curImage = System.Web.UI.WebControls.Image.FromFile(savedImageName);
imgBox.ImageUrl = savedImageName;

}
 
G

Guest

Dale,
You need to post a "short but complete" (a la MVP Jon Skeet) block of code
that will give people enough information to be able to tell what is not
right. That single line of DataReader code isn't sufficient.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




dale zhang said:
Hi Peter,

Thank you providing this important info.

I changed my reading as below:

retval = dbDR.GetBytes(0, 78, outbyte, 0, bufferSize);

still can not display. When I opened the saved file in wordpad, I saw
nothing. Before I can see:

System.Byte [ ]

Did I do it wrongly?

-Dale
Peter Bromberg said:
bitmaps stored in MS Access normally have a 78 byte OLE Header that you need
to strip off before saving the remaining bytes.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




dale zhang said:
Hi,

I am trying to save and read an image from MS Access DB based on the
following article:

http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

Right now, I saved images without any errors. After reading the ole object
from db, I saved it to C: as file1.bmp and displayed on the web. But it can
not be displayed. After I manually sent the file to wordpad, it shows

System.Byte [ ]

Now I suspect my saving an image might be wrong. The table has 2 columns:
username and userfile. Userfile column shows

.ong binary data

I can not find a way to verify if data was saved ok? But saving does not
report any errors. I am attached my saving and reading codes here to see if
anyone can help?

THanks. –dale
private void btnSaveToDB_Click(object sender, System.EventArgs e)
{
if (dListUsers.SelectedValue == "")
{
lblFileAccess.Text = "You need to select an user first!";
return;
}
curFileName = myFile.PostedFile.FileName;
// only the attched file name not its path
string c = System.IO.Path.GetFileName(curFileName);
// Read a bitmap contents in a stream
FileStream fs = new FileStream(curFileName, FileMode.OpenOrCreate,
FileAccess.Read);
byte[] rawData = new byte[fs.Length];
fs.Read(rawData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
// Construct a SQL string and a connection object
OleDbConnection dbConn;
OleDbCommand dbCmd;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
string sSQL;

sSQL = ("INSERT INTO UserFiles (UserName,UserFile) "
+ ("VALUES ("
+ (dbClass.DelimString(dListUsers.SelectedValue) + (","
+ ("\'"+rawData + "\')")))));
try
{
// write the visit log entry
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sSQL, dbConn);
dbCmd.ExecuteNonQuery();
dbConn.Close();
lblFileAccess.Text = "The file has been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
lblFileAccess.Text = "The file has not been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
}

private void btnReadFmDB_Click(object sender, System.EventArgs e)
{
OleDbConnection dbConn;
OleDbCommand dbCmd;
OleDbDataReader dbDR;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
// Construct a SQL string and a connection object
string sql = "SELECT UserFile FROM UserFiles WHERE Username =\'"
+ dListUsers.SelectedValue + "\'";
FileStream fs;
BinaryWriter bw;
int bufferSize = 300000;
//byte[] outbyte;
byte[] outbyte = new byte[300000 - 1];

long retval;
//long startIndex = 0;
//string pub_id = "";

try
{
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sql, dbConn);
dbDR = dbCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dbDR.Read())
{
fs = new FileStream(savedImageName, FileMode.OpenOrCreate,
FileAccess.Write);
bw = new BinaryWriter(fs);
//startIndex = 0;
retval = dbDR.GetBytes(0, 0, outbyte, 0, bufferSize);

bw.Write(outbyte);
bw.Flush();
// Close the output file.
bw.Close();
fs.Close();
}
// get the end
dbConn.Close();
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
return;
}
// Display image
//curImage = System.Web.UI.WebControls.Image.FromFile(savedImageName);
imgBox.ImageUrl = savedImageName;

}
 
G

Guest

Peter,

Sorry. Enclosed is the related codes based on your advice. I appreciate your
help. -Dale

string curFileName = null;
string savedImageName = "C:\\imageFromDb.BMP";

private void btnSaveToDB_Click(object sender, System.EventArgs e)
{
if (dListUsers.SelectedValue == "")
{
lblFileAccess.Text = "You need to select an user first!";
return;
}
curFileName = myFile.PostedFile.FileName;
// only the attched file name not its path
string c = System.IO.Path.GetFileName(curFileName);
// Read a bitmap contents in a stream
FileStream fs = new FileStream(curFileName, FileMode.OpenOrCreate,
FileAccess.Read);
byte[] rawData = new byte[fs.Length];
fs.Read(rawData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
// Construct a SQL string and a connection object
OleDbConnection dbConn;
OleDbCommand dbCmd;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
string sSQL;

sSQL = ("INSERT INTO UserFiles (UserName,UserFile) "
+ ("VALUES ("
+ (dbClass.DelimString(dListUsers.SelectedValue) + (","
+ ("\'"+rawData + "\')")))));
try
{
// write the visit log entry
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sSQL, dbConn);
dbCmd.ExecuteNonQuery();
dbConn.Close();
lblFileAccess.Text = "The file has been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
lblFileAccess.Text = "The file has not been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
}

private void btnReadFmDB_Click(object sender, System.EventArgs e)
{
OleDbConnection dbConn;
OleDbCommand dbCmd;
OleDbDataReader dbDR;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
// Construct a SQL string and a connection object
string sql = "SELECT UserFile FROM UserFiles WHERE Username =\'"
+ dListUsers.SelectedValue + "\'";
FileStream fs;
BinaryWriter bw;
int bufferSize = 300000;
//byte[] outbyte;
byte[] outbyte = new byte[300000 - 1];

long retval;
//long startIndex = 0;
//string pub_id = "";

try
{
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sql, dbConn);
dbDR = dbCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dbDR.Read())
{
fs = new FileStream(savedImageName, FileMode.OpenOrCreate,
FileAccess.Write);
bw = new BinaryWriter(fs);
//startIndex = 0;
retval = dbDR.GetBytes(0, 78, outbyte, 0, bufferSize);

bw.Write(outbyte);
bw.Flush();
// Close the output file.
bw.Close();
fs.Close();
}
// get the end
dbConn.Close();
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
return;
}
// Display image
//curImage = System.Web.UI.WebControls.Image.FromFile(savedImageName);
imgBox.ImageUrl = savedImageName;

}



Peter Bromberg said:
Dale,
You need to post a "short but complete" (a la MVP Jon Skeet) block of code
that will give people enough information to be able to tell what is not
right. That single line of DataReader code isn't sufficient.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




dale zhang said:
Hi Peter,

Thank you providing this important info.

I changed my reading as below:

retval = dbDR.GetBytes(0, 78, outbyte, 0, bufferSize);

still can not display. When I opened the saved file in wordpad, I saw
nothing. Before I can see:

System.Byte [ ]

Did I do it wrongly?

-Dale
Peter Bromberg said:
bitmaps stored in MS Access normally have a 78 byte OLE Header that you need
to strip off before saving the remaining bytes.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




:

Hi,

I am trying to save and read an image from MS Access DB based on the
following article:

http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

Right now, I saved images without any errors. After reading the ole object
from db, I saved it to C: as file1.bmp and displayed on the web. But it can
not be displayed. After I manually sent the file to wordpad, it shows

System.Byte [ ]

Now I suspect my saving an image might be wrong. The table has 2 columns:
username and userfile. Userfile column shows

.ong binary data

I can not find a way to verify if data was saved ok? But saving does not
report any errors. I am attached my saving and reading codes here to see if
anyone can help?

THanks. –dale
private void btnSaveToDB_Click(object sender, System.EventArgs e)
{
if (dListUsers.SelectedValue == "")
{
lblFileAccess.Text = "You need to select an user first!";
return;
}
curFileName = myFile.PostedFile.FileName;
// only the attched file name not its path
string c = System.IO.Path.GetFileName(curFileName);
// Read a bitmap contents in a stream
FileStream fs = new FileStream(curFileName, FileMode.OpenOrCreate,
FileAccess.Read);
byte[] rawData = new byte[fs.Length];
fs.Read(rawData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
// Construct a SQL string and a connection object
OleDbConnection dbConn;
OleDbCommand dbCmd;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
string sSQL;

sSQL = ("INSERT INTO UserFiles (UserName,UserFile) "
+ ("VALUES ("
+ (dbClass.DelimString(dListUsers.SelectedValue) + (","
+ ("\'"+rawData + "\')")))));
try
{
// write the visit log entry
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sSQL, dbConn);
dbCmd.ExecuteNonQuery();
dbConn.Close();
lblFileAccess.Text = "The file has been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
lblFileAccess.Text = "The file has not been saved successfully for "
+ dListUsers.SelectedValue + ".";
return;
}
}

private void btnReadFmDB_Click(object sender, System.EventArgs e)
{
OleDbConnection dbConn;
OleDbCommand dbCmd;
OleDbDataReader dbDR;
string applicationState = ((string)(Application["DBType"])).ToLower();
string sConn = dbClass.Connect(applicationState);
// Construct a SQL string and a connection object
string sql = "SELECT UserFile FROM UserFiles WHERE Username =\'"
+ dListUsers.SelectedValue + "\'";
FileStream fs;
BinaryWriter bw;
int bufferSize = 300000;
//byte[] outbyte;
byte[] outbyte = new byte[300000 - 1];

long retval;
//long startIndex = 0;
//string pub_id = "";

try
{
dbConn = new OleDbConnection(sConn);
dbConn.Open();
dbCmd = new OleDbCommand(sql, dbConn);
dbDR = dbCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (dbDR.Read())
{
fs = new FileStream(savedImageName, FileMode.OpenOrCreate,
FileAccess.Write);
bw = new BinaryWriter(fs);
//startIndex = 0;
retval = dbDR.GetBytes(0, 0, outbyte, 0, bufferSize);

bw.Write(outbyte);
bw.Flush();
// Close the output file.
bw.Close();
fs.Close();
}
// get the end
dbConn.Close();
}
catch (Exception excep)
{
Debug.WriteLine(excep.Message);
return;
}
// Display image
//curImage = System.Web.UI.WebControls.Image.FromFile(savedImageName);
imgBox.ImageUrl = savedImageName;

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top