如何向ACCESS中存取图片,求ASP.NET参考代码

解决方案 »

  1.   

    http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=185154参考
      

  2.   

    上面网址中的程序代码我有两点不大清楚:1.
    store  it  :    
     
     
     Stream  imgdatastream  =  File1.PostedFile.InputStream;    
           
       int  imgdatalen  =  File1.PostedFile.ContentLength;    
           
       string  imgtype  =  File1.PostedFile.ContentType;    
    这里面的File1是控件吗,如何在自己的程序中表示出来呢
    2.在
      

  3.   

    2.在
    show  it  :    
     
     private  void  Page_Load(object  sender,  System.EventArgs  e)    
           
       {    
           
       string  imgid  =Request.QueryString["imgid"]; 
    中的“imgid”是提前定义的吗,是在提交部分的那个部分定义的,能告诉我如何定义的或定义规则吗
      

  4.   

    我现在用下面的代码向数据库中存入图片,为什么总是显示INERT INTO处有语法错误呢
    private void Button1_ServerClick(object sender, System.EventArgs e)
    {
        Stream imgdatastream=File1.PostedFile.InputStream;
    int imgdatalength=File1.PostedFile.ContentLength;
    byte []imgdata=new byte[imgdatalength];
    imgdatastream.Read(imgdata,0,imgdatalength); string InsStr="insert into IMAGE_TABLE(IMAGE) values(@image)";
    OleDbCommand cmd=new OleDbCommand(InsStr,oleDbConnection1);
    cmd.Parameters.Add(new OleDbParameter("@image",OleDbType.VarBinary,3000));
                cmd.Parameters["@image"].Value=imgdata; oleDbConnection1.Open();
    cmd.ExecuteNonQuery();
    oleDbConnection1.Close();
    }