`
sjk2013
  • 浏览: 2166084 次
文章分类
社区版块
存档分类
最新评论

Parameter \' \': No size set for variable length data type: String

 
阅读更多
错误提示:Parameter 'l_ReStatus': No size set for variable length data type: String
背景: cmd.Parameters.Add("l_ReStatus", OracleType.VarChar).Direction = ParameterDirection.Output;
执行完cmd.ExecuteNonQuery();后直接进入catch语句
public bool RunProcZX(string User_Id,out string ReStatus)
        {
            OracleConnection conn = new OracleConnection(connStr);
            conn.Open();
            OracleCommand cmd = new OracleCommand("存储过程名", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            //定义传入参数的类型。类型为OracleType.VarChar
            cmd.Parameters.Add("l_User_Id", OracleType.VarChar).Direction = ParameterDirection.Input;
            //传值
            cmd.Parameters["l_User_Id"].Value = User_Id;
            //传出参数,类似于c#中的out
            cmd.Parameters.Add("l_ReStatus", OracleType.VarChar).Direction = ParameterDirection.Output;         
            try
            {
                cmd.ExecuteNonQuery();
                ReStatus = cmd.Parameters["l_ReStatus"].Value.ToString();            
                return true;
            }
            catch
            {
                return false;
            }
            finally
            {
                conn.Close();
            }
        }
解决办法:cmd.Parameters.Add("l_ReStatus", OracleType.VarChar, 20).Direction = ParameterDirection.Output;
Parameter   : No size set for variable length data type: String - Complaint Free Wolrd - Complaint Free Wolrd
小注:

Parameter的参数设置长度(size属性)

实例化Parameter时,如果是字符型,一定要指定size属性(请使用截图显示的方法)
分享到:
评论

相关推荐

    acpi控制笔记本风扇转速

    table now includes all variable-length data fields at the end of some of the subtables. The disassembler now emits a comment if a buffer appears to be a ResourceTemplate, but cannot be disassembled ...

    BobBuilder_app

    Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. See Also More like this More by this...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    which uses the methods GetPropValue/SetPropValue for reading/writing data. - FIX: The method TCustomProp.GetPropNames moved to the public section and returns the list of published-property names of ...

    php.ini-development

    previously set variable or directive (e.g. ${foo}) ; Expressions in the INI file are limited to bitwise operators and parentheses: ; | bitwise OR ; ^ bitwise XOR ; & bitwise AND ; ~ bitwise NOT ; ! ...

    au3反编译源码

    'Chr() string encode' Tested with: AutoIT : v3. 3. 0.0 and AutoIT : v2.64. 0.0 and AutoHotKey: v1.0.48.5 The options: =========== 'Force Old Script Type' Grey means auto detect and is the ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Other C++ Features Reference Arguments Function Overloading Default Arguments Variable-Length Arrays and alloca() Friends Exceptions Run-Time Type Information (RTTI) Casting Streams Preincrement and ...

    JSP Simple Examples

    Suppose if we have a declare an array of type String, then it will store only the String value not any other data type. When we have a closely related data of the same type and scope, it is better to...

    端口查看工具

    active filter state and no filter state, as an alternative for 'Clear All Filters', which doesn't allow you to return back the filters. * Version 1.70: o Added /sort command-line option for ...

    Python for Bioinformatics 第二版,最新版

    8.5.1 Create a New Data Type Using a Built-in Data Type 154 8.6 MAKING OUR CODE PRIVATE 154 8.7 ADDITIONAL RESOURCES 155 8.8 SELF-EVALUATION 156 Chapter 9 Introduction to Biopython 157 9.1 WHAT IS ...

    servlet2.4doc

    String identifier for Client Certificate authentication. clone() - Method in class javax.servlet.http.Cookie Overrides the standard java.lang.Object.clone method to return a copy of this cookie. ...

    Java邮件开发Fundamentals of the JavaMail API

    framework adds support for typing arbitrary blocks of data and handling it accordingly. This doesn't sound like much, but it is your basic MIME-type support found in many browsers and mail tools ...

    Delphi7.1 Update

    * TClientDataSet doesn‘t save data to file when FileName is set and there is no existing file on disk (Quality Central 2307). * Using the Delphi 7 version of midas.dll to open an XML file that was ...

    i-vector的工具箱

    This toolbox provides support for these normalization techniques, although no tool for feature extraction or SAD is provided. The Auditory Toolbox (Malcolm Slaney) and VOICEBOX (Mike Brooks) which ...

    计算机网络第六版答案

    All of these delays are fixed, except for the queuing delays, which are variable. 17. a) 1000 km, 1 Mbps, 100 bytes b) 100 km, 1 Mbps, 100 bytes 18. 10msec; d/s; no; no 19. a) 500 kbps b) 64 ...

    SQL示例大全.pdf

    Syntax for CONVERT: CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) 不带世纪数位 (yy) (1) 带世纪数位 (yyyy) 标准 输入/输出 (3) - 0 或 100 (1, 2) 默认设置 mon dd yyyy hh:miAM(或 PM...

    VB.NET Developer's Guide(4574).pdf

    Data Sources for Data Binding 333 Using the Data Form Wizard 334 Using the Windows Forms Class Viewer 338 Using the Windows Forms ActiveX Control Importer 338 Summary 340 Solutions Fast Track ...

    Sakemail

    .- Reduced the line sleep to 30 (tell me if this value doesn‘t work for you).27/4/981.7.0- Fixed a memory leak, thanks to Don Higgins.- Moved the string esErrorInFormatOfMsg to a property of SakPOP.-...

    The Art of Assembly Language Programming

    QWORD, and TBYTE Variables 5.3.5 - Declaring Floating Point Variables with REAL4, REAL8, and REAL10 5.4 - Creating Your Own Type Names with TYPEDEF 5.5 - Pointer Data Types 5.6 - ...

    Tricks of the Windows video Game Programming---part1

    Hungarian Notation........................55 Variable Naming ..............................................................................56 Function Naming........................................

Global site tag (gtag.js) - Google Analytics