private void readimagebtn_click(object sender,system.eventargs e)
{
//构造一个SQL字符串和一个连接对象
string sql="select * from users ";
oledbconnection conn=new oledbconnection();
conn.connectionstring=connectionstring;
//打开连接
if (conn.state!=connectionstate.open)
conn.open();
oledbdataadapter adapter= new oledbdataadapter (sql,conn);
oledbcommandbuilder cmdbuilder=new oledbcommandbuilder (adapter);
dataset ds =new dataset("users");
adapter.missingschemaaction=missingschemaaction.addwithkey;
//填充数据适配器
adapter.fill(ds,"users");
//获取表的第一行
datarow row=ds.tables["users"].rows[0];
//读取流中的数据
byte[] rawdata=new byte[0];
rawdata=(byte[])row["userphoto"];
int len=new int();
len=rawdata.getupperbound(0);
//将rawdata保存为位图
fil