Hi,
iam doing c# windows application.
i save a image into the database,but iam unable to retrive image from database
it is giving error "parameter is not valid ";
mycode is :
string query = "select photo from cust1 where id=" + id;
FbDataAdapter adb = new FbDataAdapter(q uery, cnn);
DataSet ds = new DataSet();
adb.Fill(ds, "cust1");
if (ds.Tables[0].Rows.Count > 0)
{
DataRow dr;
dr = ds.Tables[0].Rows[0];
if (!dr["photo"].Equals(DBNull. Value))
{
byte[] content = (byte[])dr["photo"];
MemoryStream stream = new MemoryStream(co ntent);
photo = stream;
}
}
Bitmap img = new Bitmap(objcls.p hoto);-----------------------"error"
pictureBox1.Siz eMode = PictureBoxSizeM ode.StretchImag e;
pictureBox1.Ima ge = img;
please give me information where the problem is
iam doing c# windows application.
i save a image into the database,but iam unable to retrive image from database
it is giving error "parameter is not valid ";
mycode is :
string query = "select photo from cust1 where id=" + id;
FbDataAdapter adb = new FbDataAdapter(q uery, cnn);
DataSet ds = new DataSet();
adb.Fill(ds, "cust1");
if (ds.Tables[0].Rows.Count > 0)
{
DataRow dr;
dr = ds.Tables[0].Rows[0];
if (!dr["photo"].Equals(DBNull. Value))
{
byte[] content = (byte[])dr["photo"];
MemoryStream stream = new MemoryStream(co ntent);
photo = stream;
}
}
Bitmap img = new Bitmap(objcls.p hoto);-----------------------"error"
pictureBox1.Siz eMode = PictureBoxSizeM ode.StretchImag e;
pictureBox1.Ima ge = img;
please give me information where the problem is
Comment