当前位置:首页 » 多媒体相关

在线等待,怎样在ADO.net里用OleDb插入视频文件(如.mpeg)到Oracle数据库中??


怎样在ado.net里用oledb插入视频文件(如.mpeg)到oracle数据库中?  
  最好给出部分源代码   谢谢   解决   马上就给分

推荐阅读

  • 经典老机终于再降一周降价信息汇总 [详细内容]
  • 绚烂如花 爱华AZ-ES256新鲜日志 [详细内容]
  • 910几个有趣的小问题 [详细内容]
  • 东边涨价西边降 本周手机报价汇总 [详细内容]
  • ATP率先向全球发布256M RS-MMC卡 [详细内容]
  • 如何传图片、铃声以及游戏 [详细内容]
  • 不看不明白价格变化快手机报价汇总周报 [详细内容]
  • 网友回答:
    网友:cmic

    没做过,感觉应该和插入图片差不多。

    网友:panyee

    看看上次某某兄弟贴上来的oracle写图片的例子,   你改一改  
      图片存在long   raw类型的字段里  
       
        stream   imgdatastream   =   file1.postedfile.inputstream;  
      int   imgdatalen   =   file1.postedfile.contentlength;  
      string   imgtype   =   file1.postedfile.contenttype;  
      string   imgtitle   =   textbox1.text;  
      byte[]   imgdata   =   new   byte[imgdatalen];  
      int   n   =   imgdatastream.read(imgdata,0,imgdatalen);  
                           
       
      oraclecommand   mycommand   =   new   oraclecommand("insert   into   uu(ufiletitle,   ufiletype,   ufiledata)   values   (:imgtitle,:imgtype,   :imgdata)");  
      mycommand.connection   =   new   oracleconnection("data   source=oa;user   id=jack;password=dian;integrated   security=no;");  
      mycommand.commandtype   =   commandtype.text;  
       
      oracleparameter   paramtitle   =   new   oracleparameter(   ":imgtitle",   oracletype.varchar,   50);  
      paramtitle.value   =   imgtitle;  
      mycommand.parameters.add(   paramtitle   );  
       
       
      oracleparameter   paramtype   =   new   oracleparameter(   ":imgtype",   oracletype.varchar,   50);  
      paramtype.value   =   imgtype;  
      mycommand.parameters.add(   paramtype   );  
       
      oracleparameter   paramdata   =   new   oracleparameter(   ":imgdata",   oracletype.longraw);  
      paramdata.value   =   imgdata;  
      mycommand.parameters.add(   paramdata   );  
       
              mycommand.connection.open();  
       
      mycommand.executenonquery();  
       
      mycommand.connection.close();  
      显示的:  
      oraclecommand   mycommand   =   new   oraclecommand("select   ufiletype,ufiledata     from   uu   where   ufiletitle=bnm");  
      mycommand.connection   =   new   oracleconnection("data   source=oa;user   id=jack;password=dian;integrated   security=no;");  
      mycommand.commandtype   =   commandtype.text;  
      mycommand.connection.open();  
      oracledatareader   dr   =mycommand.executereader();  
      if(dr.read())  
      {  
      //stream   imgdatastream   =   dr["ufiledata"];  
      response.contenttype   =   dr["ufiletype"].tostring();  
      response.binarywrite((byte[])dr["ufiledata"]);  
      //response.write(dr["ufiledata"]);  
      }  
      mycommand.connection.close();  
     

    网友:qimini

    mark

    .

    讨论区

    Login