给你一段参考代码。是存到access的
string Str_Title,Str_Description;
Str_Title=this.Title.Text;
 
Str_Description=this.Description.Text;
//title,description,info,olepic,inserttime,ext
//DataSet MyDS2=new DataSet();
//MyDS2=this.MyDs.Clone();
this.MyCommand.CommandText="select inserttime,title,info,description,ext,olepic from PicList order by inserttime desc" ; 

System.Data.DataRow myRow=MyDs.Tables[0].NewRow();

//MyDs.Tables["PicList"].NewRow(); 
myRow[0]=System.DateTime.Now;
myRow[1]=Str_Title;
Stream fs=this.ImgFile.PostedFile.InputStream; FileInfo newfile=new FileInfo(this.ImgFile.PostedFile.FileName);
byte[] myDoc=new Byte[fs.Length]; fs.Read(myDoc,0,myDoc.Length); System.Drawing.Image MyImg;
try
{
MyImg=System.Drawing.Image.FromStream(fs);
myRow[2]="大小:"+fs.Length+"字节"; 
myRow[2]=myRow[2]+";宽:"+MyImg.Width;
myRow[2]=myRow[2]+";高:"+MyImg.Height;
}
catch(Exception Err)
{

if(Err.ToString().IndexOf("System.ArgumentException",0,Err.ToString().Length)>=0)
{
Response.Write("请选择小于4M的图像文件,谢谢!");
Response.Write("<a href='javascript:history.back(-1)'>返回</a>");
} Response.End(); }

         

myRow[3]=Str_Description;
myRow[4]=newfile.Extension; 
myRow[5]=myDoc; /*string UpFileName;
if(!this.ImgFile.PostedFile.FileName.Equals("")) 
{
UpFileName=this.ImgFile.PostedFile.FileName;
//Response.Write(UpFileName.Substring(UpFileName.Length-3));
myRow[6]=UpFileName.Substring(UpFileName.Length-3);
}
*/ this.MyDs.Tables[0].Rows.InsertAt(myRow,0);
 
OleDbCommandBuilder cb=new OleDbCommandBuilder(MyAdapter);

try
{
MyAdapter.Update(MyDs,MyDs.Tables[0].TableName);}
catch(Exception)
{
Response.Write("<div align=center>Message Recorded successfully!</div>");
this.MyDs.Tables[0].Rows.Remove(myRow);
}
this.DataGrid1.DataBind();
this.Title.Text="";
this.Description.Text="";