“未实现或不合理的转换”尝试将图像保存到大小超过4k的oracle BLOB时出错。我在asp.net 4.0中使用Oracle 11g。 [英] "Unimplemented or unreasonable conversion" error when trying to save images into oracle BLOB having more than 4k size. Im using Oracle 11g with asp.net 4.0 .

查看:84
本文介绍了“未实现或不合理的转换”尝试将图像保存到大小超过4k的oracle BLOB时出错。我在asp.net 4.0中使用Oracle 11g。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮帮我太紧急!!!

我需要存储图片本身而非他们的路径







我要求将图像保存到数据库中。



我的问题描述是:



我有一个上传图像的asp.net 4.0 Web应用程序,然后我的应用程序将该图像转换为字节数组并将该图像保存到数据库中,它的图像尺寸小于4KB但是大小较大的图像会产生错误未实现或不合理的转换我正在使用Oracle 11g数据库。

这是我的功能:







Please Help me Its way too urgent!!!
and i need to store images itself not their path



I have the requirement to save image into Database.

Description of my question is :

I have a asp.net 4.0 web application that uploads a image and then my application converts that image into byte array and save that image into database it works fine with image less than 4KB in size but images whose size is greater it generates error "Unimplemented or unreasonable Conversion" i am using Oracle 11g database.
Here is my function :



public void saveImage( byte[] inImage )
       {
           try
           {
               int iCount = 0;
               OracleParameter[] param = new OracleParameter[2];



              


              

               param[iCount] = new OracleParameter("inImage", OracleType.Blob);
               param[iCount].Direction = ParameterDirection.Input;
               param[iCount].Value = inImage;
               iCount++;

             
           

               iCount++;
               param[iCount] = new OracleParameter("outVal", OracleType.Number);
               param[iCount].Direction = ParameterDirection.Output;


               AdoHelper.ExecuteDataset(this.GetConnectionString(), "IRGWEBUSERDOCUMENT.spSaveDocument", param);



           }
           catch
           {
               throw;
           }
       }

PACKAGE IRGWEBUSERDOCUMENT CONTAINS THE FOLLOWING PROCEDURE

PROCEDURE spSaveDocument
(
 inImage in BLOB,
 outVal out number
)
as

BEGIN
outVal := -1;
INSERT INTO TBLIRGUSERDOCUMENT (IMAGE)
VALUES
(
inImage,
);
outVal := 1;
commit;
END spSaveDocument;

推荐答案

使用Oracle Transaction解决问题!!!
Problem has been resolved by using Oracle Transaction!!!


这篇关于“未实现或不合理的转换”尝试将图像保存到大小超过4k的oracle BLOB时出错。我在asp.net 4.0中使用Oracle 11g。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆