首页 新闻 会员 周边 捐助

winForm二进制数组保存进Oacle BOLO字段方法哪错了

0
[待解决问题]

表结构:
create table tb_user--员工信息表
(
  useId nvarchar2(50) primary key, --员工信息表主键
  useNum nvarchar2(20) not null,--编号
  useAccount nvarchar2(20) not null, --账号
  usePwd nvarchar2(20) not null,--密码
  useName nvarchar2(10) not null,--姓名
  sex nvarchar2(2),--性别
  useAge int not null,--年龄
  useIDCard nvarchar2(20) not null,--身份证
  usePhone nvarchar2(30) not null,--手机
  useLandline nvarchar2(20),--座机xxxxxxxxxxxxxx
  useEmail nvarchar2(200),--邮箱xxxxxxxxxxxxx
  useBirthday nvarchar2(50) not null,--出生日期
  useEntryDate nvarchar2(50) not null,--入职日期
  useAddDate nvarchar2(50) not null,--添加日期
  useIntroduction nvarchar2(2000),--介绍xxxxxxxxxxxxx
  useAvatarImage LONG,--头像xxxxxxxxxxxxxx
  posId nvarchar2(50) not null,--职位表主键
  depId nvarchar2(50) not null, --部门主键
  staId nvarchar2(50) not null, --工作状态主键
  plvId nvarchar2(50) not null, --级别主键
  rolId nvarchar2(50) not null --角色主键
)

存储过程:

create or replace procedure p_insertUser(uZh in varchar2,uMm in varchar2,uName in varchar2,uSex in varchar2,uAge in int,uCard in varchar2,
uPhone in varchar2,uGuPhone in varchar,uEmil in varchar2,uSr in varchar2,uRz in varchar2,uTj in varchar2,uJs in varchar2,uImage in LONG,
uZhiWei in varchar2,uBuMen in varchar2,uZhuangTai in varchar2,uJiBie in varchar2,uJueSe in varchar2)
as
begin
  insert into tb_user values(CreateGUID(),
  CONCAT('XDH-',(SELECT lpad((TO_NUMBER(substr((select useNum from(select useNum from tb_user order by useNum desc)where rownum <=1),5))+1),TO_NUMBER(length(substr((select useNum from(select useNum from tb_user order by useNum desc)where rownum <=1),5))),'0') FROM dual)),
  uZh,uMm,uName,uSex,uAge,uCard,uPhone,uGuPhone,uEmil,uSr,uRz,uTj,uJs,uImage,uZhiWei,uBuMen,uZhuangTai,uJiBie,uJueSe);
end;

 

dbHeple方法:

/// <summary>
        /// 用于增删改操作,返回布尔结果。
        /// </summary>
        /// <param name="proc">默认false,如果为true则使用存储过程</param>
        /// <param name="Oracle">Oracle</param>
        /// <param name="par">输入参数</param>
        /// <returns>返回Bool类型,成功返回true,失败返回false</returns>
        public static bool GetNonQuery(bool proc, string Oracle, params OracleParameter[] par)
        {
            try
            {
                SetCmd(Oracle);
                if (proc)
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddRange(par);
                }
                return (cmd.ExecuteNonQuery().Equals(1)) ? true : false;
            }
            catch
            {
                return false;
            }
            finally
            {
                ConnectStatus();
            }
        }

调用方法:

OracleParameter[] para = {
                new OracleParameter("uZh", user.useAccount),
                new OracleParameter("uMm", user.usePwd),
                new OracleParameter("uName", user.useName),
                new OracleParameter("uSex", user.sex),
                new OracleParameter("uAge", user.useAge),
                new OracleParameter("uCard", user.useIDCard),
                new OracleParameter("uPhone", user.usePhone),
                new OracleParameter("uGuPhone", uLanDline),
                new OracleParameter("uEmil", uEmail),
                new OracleParameter("uSr", user.useBirthday),
                new OracleParameter("uRz",user.useEntryDate),
                new OracleParameter("uTj", user.useAddDate),
                new OracleParameter("uJs", uIntrod),
                new OracleParameter("uImage", uImage),
                new OracleParameter("uZhiWei", user.posId),
                new OracleParameter("uBuMen", user.depId),
                new OracleParameter("uZhuangTai", user.staId),
                new OracleParameter("uJiBie", user.plvId),
                new OracleParameter("uJueSe", user.rolId)
                };
            return DBHelp.GetNonQuery(true, "p_insertUser", para);

 

确定都有值 uImage是一个byte数组,

报的错误是:转换请求无法实施或不合理。求大神指点...要怎么改...

在线跪求..新人没有圆豆,我可以给QB....

不会轻易悲伤的主页 不会轻易悲伤 | 初学一级 | 园豆:4
提问于:2014-05-08 16:22
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册