read settlement opening db picturebox


i have perplexing review settlement saved opening db ole vigilant picturebox c# windows application.



the formula does presented below:



        twine connstring = @"provider=microsoft.jet.oledb.4.0;data source=d:\rajesh\sampledb_2003.mdb;";
oledbconnection oconn = new oledbconnection(connstring);
oconn.open();
twine commandstring = "select * worker where id = " + id + "";
oledbcommand ocmd = new oledbcommand(commandstring, oconn);
oledbdatareader oreader = ocmd.executereader(commandbehavior.sequentialaccess);

while (oreader.read())
{
txtid.text = ((int)oreader.getvalue(0)).tostring();
txtname.text = (string)oreader.getvalue(1);
txtage.text = ((int)oreader.getvalue(2)).tostring();
txttype.text = (string)oreader.getvalue(3);
byte[] imagebytes = (byte[])oreader.getvalue(4);

memorystream ms = new memorystream();
ms.write(imagebytes, 0, imagebytes.length);
bitmap bmp = new bitmap(ms);
pbpassport.image = bmp;
}


when i govern above code, an 'parameter valid' difference thrown during line:



bitmap bmp = new bitmap(ms)


from difference message, pristine 'ms' format recognisable. any idea past this?



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?