Hello,
this is the coding i have used for retrieving image from sql server 2005 database using c#.net windows application.
string selimage = "select VehiclePhoto from tbl_VehicleMaster where VehicleName='" + cmbVehicleName.Text + "'";
cmd = new SqlCommand(selimage, con);
da = new SqlDataAdapter(cmd);
da.Fill(ds, "tbl_VehicleMaster");
int c = ds.Tables["tbl_VehicleMaster"].Rows.Count;
if (c > 0)
{
Byte[] byteblobdata = new Byte[0];
byteblobdata = (Byte[])(ds.Tables["tbl_VehicleMaster"].Rows[c - 1]["VehiclePhoto"]);
MemoryStream ms = new MemoryStream(byteblobdata, true);
pBrowse.Image = Image.FromStream(ms);
pBrowse.SizeMode = PictureBoxSizeMode.StretchImage;
pBrowse.Refresh();
error:
i got a error like parameter is not valid.could u ple help me or there is any other solution is thereConfiguration: Windows XP
Firefox 3.5.5
