string strCnn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\att2000.mdb;Persist Security Info=True";
OleDbConnection myConnection = new OleDbConnection(strCnn);
myConnection.Open();
OleDbCommand command = new OleDbCommand("select * from Template ", myConnection);
OleDbDataReader dr = command.ExecuteReader();
byte[] buff = null;
string aaa = "";
string bbb = "";
if (dr.Read())
{
buff = (byte[])dr["Template4"];
}
//System.IO.MemoryStream ms = new System.IO.MemoryStream(buff);
////通过流对象建立Bitmap
//System.Drawing.Bitmap bmp = new Bitmap(ms);
//bmp.Save("e:\\SampImag.jpg");
myConnection.Close();
System.IO.FileStream stream = new System.IO.FileStream(Server.MapPath("m.txt"),System.IO.FileMode.CreateNew, System.IO.FileAccess.Write);
System.IO.BinaryWriter bw = new System.IO.BinaryWriter(stream);
bw.Write(buff);
bw.Close();
stream.Close();
取的是别人数据库上的数据,也不知道原来什么格式。谁能帮忙指点下!