使用OLEDB Provider将映像保存在Oracle DB中 [英] Save image in Oracle DB using OLEDB Provider

查看:67
本文介绍了使用OLEDB Provider将映像保存在Oracle DB中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要使用oledb将图像保存在oracle中.我的代码在下面...

Hi,

I need to save an image in oracle using oledb. My code is below...

string query = "insert into signtable(Cname,Csign) values('" + saveLocation + "'," + " :BlobParameter )";
OleDbParameter blobParameter = new OleDbParameter();
blobParameter.OleDbType = OleDbType.Binary;
blobParameter.ParameterName = "BlobParameter";
blobParameter.Value = blob;    //here blob contains byte[] of image's data
cmd = new OleDbCommand(query, con);
cmd.Parameters.Add(blobParameter);
cmd.ExecuteNonQuery(); //here error


它会引发错误,因为
ORA-01008:并非所有变量都已绑定

请告诉我我在哪里出错了...我是oracle的新手...请....从这个帮助我:(

我进行了大搜索...但是没有运气:(


it throws an error as
ORA-01008: not all variables bound

Please tell me where i made mistake...I am new to oracle... Please....Help me out from this :(

I had made a big search...but no luck :(

推荐答案

是否
Does this[^] help?

I''m also curious why use a parameter for the blob field, but not for the location.

Do this:
string query = "insert into signtable(Cname,Csign) values(:saveLocation, :BlobParameter)"



并添加savelocation作为参数.


也可能是



and add the savelocation as parameter as well.


also it could be that

blobParameter.ParameterName = "BlobParameter";

应该是

blobParameter.ParameterName = ":BlobParameter";


这篇关于使用OLEDB Provider将映像保存在Oracle DB中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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