| 发表于:2007-01-31 11:10:061楼 得分:0 |
厄,下面是我程序里面的一段,可以正常运行。 怀疑你是不是漏了 byte[] buffer = new byte[stream.length];类似的一句话,而且filestream实例化少参数 system.io.filestream stream = new system.io.filestream(filepath, system.io.filemode.open, system.io.fileaccess.read); byte[] buffer = new byte[stream.length]; stream.read(buffer, 0, (int)stream.length); stream.close(); this.sqlconn.open(); sqlcommand cmd=new sqlcommand( "update notify set notifydata=@notifydata where notifyid=@notifyid ",this.sqlconn); cmd.parameters.add( "@notifydata ",sqldbtype.image).value=buffer; cmd.parameters.add( "@notifyid ",sqldbtype.int).value=notifyid; cmd.EXECutenonquery(); this.sqlconn.close(); | | |
|