Char data type in mvc

Char data type taking the numeric value  instead  of char data type while binding in the Mvc view

For MVC questions please use the ASP.NET forums:
http://forums.asp.net/1146.aspx/1?MVC

Similar Messages

  • Initialization for char data type?

    I observed that as String I can declare something like this:
    String str = ""; but for char data type, if I declare:
    char ch = ''; the compiler will have an error: "empty character literal". So how can I fixe this problem when I want to initialize my char variables as "empty"? Anyone got an idea?
    Message was edited by:
    hoangSoccer
    Message was edited by:
    hoangSoccer

    Strings (and StringBuffers/Builders) are collections* of characters - so it makes
    sense to be able to refer to a String with precisely zero characters. But char is not a collection of anything - it has whatever value it has and can never
    be empty.
    *collections with a small 'c'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to call VC++ dll whiich return char[] data type value in powerbuilder

    Hi Everyone,
    I am using PowerBuilder 11.1 build 8123.
    I am calling VC++ DLL in our PowerBuilder application which return char[] data type value.
    I just declare Global External Function:-
         Function  char getOSSectionName() library "DocServClient.dll" alias for "getOSSectionName;Ansi"
    And then call this function in window as:-
         Char      ls_section[1] = 'DOCAPPLICATIONS9X'
         ls_section[1]=getOSSectionName()
    When I check ls_section[1] value in messagebox it display a symbol (please check attached attached image.)
    VC++ function and return variable declaration:-
         __declspec(dllexport) char *  __stdcall getOSSectionName()
           char    SectionName[_MAX_PATH];
    Please let me know that my code is valid or not.
    Please help..

    Hi,
    Thanks to Everyone for your suggestions.
    I am solved my problem to change VC++ function as :-
         Int __declspec(dllexport)  __stdcall getOSSectionName(char* SectionName)
                        instead of
         __declspec(dllexport) char *  __stdcall getOSSectionName()
    and declare global function as:-
           Function int getOSSectionName(Ref char ls_section[100]) library "DocServClient.dll" alias for "getOSSectionName;Ansi"
    and call function in window as:-
         int li_ret
         char ls_section[100]
         string ls_sec
         li_ret=getOSSectionName(REF ls_section)
         ls_sec=ls_section
    Thanks,
    Vikrant

  • Does CHAR data type work with Forms 11g

    We have an application in Forms 11g (32bit - version 11.1.2.0.0). DB is a Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production.
    When our Forms calls a stored procedure which has parameters defined using column name type (i.e. like p_customer_code customers.code%TYPE ) and if the column data type is CHAR we get a run time error when executing the package (ORA-06502: PL/SQL: numeric or value error string).
    When we change the data type of the tables column to varchar2, it works??
    Problem is we have dozens of tables with CHAR data type columns and we can't do all the changes manually. For one thing, if they are part of a primary or unique key or even foreign key, we can't change the data type of the column without dropping the constraint.
    What is the solution to this pls??

    When our Forms calls a stored procedure which has parameters defined using column name type (i.e. like p_customer_code customers.code%TYPE ) and if the column data type is CHAR we get a run time error when executing the package (ORA-06502: PL/SQL: numeric or value error string).this might also be related to compile settings, check your NLS settings (NLS_LANG, NLS_LENGTH_SEMANTICS) both times when you compile forms AND your stored procedures.
    As for the CHAR datatype: CHAR internally is treated like a blank padded varchar:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1542606219593
    Speaking of that it might be time to use varchar2 instead your char columns. You'd have to drop and recreate your constraints, but with the help of the data dictionary (+user_tables+, user_tab_cols, user_cons_columns, user_constraints) and dbms_metadata this shouldn't be that hard.
    Also you'd of course need to recompile all your forms after you are finished, but I guess you are aware of that ;)
    cheers

  • Dates in BEx query coming into designer as a dimension with Char data type

    This must be an old issue with a well documented work around ...   but alas i can find it !
    When i build a universe over a BEx query with dates the universe designer builds them as Dimensions of CHAR type not DATE.  Therefore all WebI date functionality fails ..  eg sorting, automatic time hierarchies etc.
    What is the workaround ?
    Andrew Fox

    Is the data source an InfoSet or an InfoCube?  It appears the date type object has not been implemented yet for Infosets.  Here's SAP Note 1370410:
    Symptom
    Infoset date type objects (DATS type) are mapped as Character types in a universe based on a SAP BEX Query.
    Prompts related to the Date field variables are coming as List of values instead of Calendar in WebIntelligence.
    Reproducing the Issue
    Create a BusinessOjects universe on a Super Query which is based on a multiprovider containing an Infoset or
    Create a BEx superquery directly on Infoset.
    BusinessObjects Enterprise XI 3.1
    SAP Integrated Solutions Kit XI 3.1
    Cause
    This behaviour has been considered as an enhancement request and tracked under ADAPT01229917.
    Resolution
    This enhancement request is scheduled to be addressed in Service Pack 3 (SP3) for BusinessObjects Enterprise XI 3.1 due approximately April 2010.
    I did try a BEx query that uses an InfoCUBE as a source and the objects are coming into the universe correctly as dates.

  • Line incomaptibilty betwwen RAW and CHAR data types in SAP Unicode System.

    Hi Gurus,
    I am working in SAP Unicode system.
    We have transferred the standard programs for Non-Unicode to Unicode system.
    In one standard function module, <table name> is defined in TABLES parameter as a type of TLINE structure, which has two fields - one is 132 length CHAR and other is 2 length CHAR.
    In the same function module , one subroutine is being called, for which <table name>  is passed.
    But in the FORM of subroutine, this table is defined as a type of HLINE, which has only one field - 134 length RAW data type.
    So due to confilct in data types ( CHAR and RAW ) , I am getting an error that both data types are not line compatible.
    Do i need to use casting concept to remove the error.
    Please suggest me the way to handle this.

    hi,
    declare the table as same data type.
    dont go for any other types.
    if you still want the form table as HLINE, then before the form call declare a varibale with TLINE data type pass the values to HLINE.
    i think this will be little complex, because again it will be type incompatablity.
    we can forcefully pass the values to HLINE with a class.
    but i think no need, declaring with same data type might be easy.
    Thanks
    Vinod

  • Transfer an internal table with non char data type to an application server

    Here is a part of my code. lv_string variable was type string initially but i got an error Not mutually convertible in a Unicode Program. I changed it to type ty_afko. Now the program works but the data it puts out has just a bunch of  #####. I cannot make all value in the internal table type char because then my select statement is giving errors..  Please help...
    Type: BEGIN OF ty_afko,
           rsnum LIKE afko-rsnum,          " Number of reservation
           aprio LIKE afko-aprio,          " Order Priority
           maufnr LIKE afko-maufnr,          " Number of superior order
           lead_aufnr LIKE afko-lead_aufnr,     " Leading order in current processing
         END OF ty_afko.
    data: gt_afko         TYPE STANDARD TABLE OF ty_afko INITIAL SIZE 0,
          wa_afko         TYPE ty_afko,
    select  rsnum aprio maufnr lead_aufnr
    from afko into table gt_afko.
    IF gv_error = 'X'.
      EXIT.
    ELSE.
    <b>DATA: Lv_string type ty_afko.</b>
      loop at gt_afko into wa_afko.
        clear lv_string.
    <b>  move wa_afko to lv_string.</b>
        perform f_transfer_dataset using gc_f_afko lv_string changing gv_error.
      endloop.
    endif.
    FORM f_transfer_dataset USING         p_file
                                          p_data
                            CHANGING      p_error TYPE c.
      Data: lv_file(25) type c.
      CONCATENATE gc_path p_file INTO lv_file.
      TRANSFER p_data TO lv_file.
    ENDFORM.                    "F_TRANSFER_DATASET

    The key is to create another empty structure with fields of type c.
    TYPES:       BEGIN OF ty_resb,
                bdter TYPE RESB-BDTER,     " This field is type d
                bdmng type resb-bdmng,  " This field is type p with 3 decimals - total 14
              END OF ty_resb,
              BEGIN OF ty_resbstr,     " This structure is the same as above but the field types will be char.
               bdter(10),            
               bdmng(14),                
              END OF ty_resbstr.
    DATA:     gt_resb         TYPE STANDARD TABLE OF ty_resb,
              wa_resb         TYPE ty_resb,
           structure type  ty_resbstr. " Empty fields with the same structure as the work area.
    SELECT   bdter bdmng  FROM resb INTO corresponding fields of TABLE gt_resb.
          open dataset pfile for output in text mode encoding default.
          loop at gt_resb into wa_resb.
              clear gv_string.
            move-corresponding wa_resb to gv_string.
             perform f_transfer_dataset using gc_f_resb gv_string.     
            endloop.
         FORM f_transfer_dataset USING p_file p_data.         
           TRANSFER p_data TO lv_file.     
         ENDFORM.

  • Capability to trim char data types?

    I've got a table in oracle with a char(9) pk field named 'id'. Say I insert the value 'testid' into that field.
    From sqlplus, I can do a select * from table where id = 'testid' and everything works fine.
    However, my OC4J CMP Entity bean findByPrimaryKey method says 'entity not found'. When I have the findByPrimaryKey look for id = 'testid ' it returns the entity.
    Anybody know how I can get the finder methods to auto trim?? or is there a setting at the database level? I do not want to touch the EJB code.
    This application used to connect to db2 and the finders worked. Any help is greatly appreciated!

    You need to add some custom attributes to your parameters in the IDL. This KnowledgeBase article should answer all your questions:
    Title: How Do I Create a Type Library Using Visual C++?
    KnowledgeBase ID: 1P68ATSR

  • CHAR Data Type Containing Numeric

    I have a CHAR InfoObject, and the value contains '00991232'.    I get an error in an Update Rule when I try to assign that to another CHAR InfoObject.  The error says "characteristic value is not ALPHA-converted.
    If I write a formula or routine to assign it, it works fine, but it strips the leading zeros.
    How can I pass the value to another InfoObject without stripping the leading zeros?

    Hi,
      Try to enable the ALPHA Conversion routine for your InfoObject in Transfer rules of the infosource.In the transfer rules TAB there is a check mark to enable conversion routine, enable that and load.
    Hope this helps
    AP

  • Select query for char data type

    Hi Gurus,
         I am trying to fetch records from Z table.
    Below the select query.
    lv_low = '0900001' 
    lv_high = '0900002'
    select matnr sernr into table lt_sernr
    from   zsd_upd_deldoc
    where  sernr >= lv_low and sernr <= lv_high.
    but out put shows
    9000010
    9000011
    900002
    900001
    9000010
    9000019
    9000019
    9000018
    9000017
    9000014
    9000018
    9000017
    Expecting O/P
    900001
    900002
    Regards
    Vinayak Sapkal

    tables: zsd_upd_deldoc.
    data: begin of lt_table occurs 0,
    sign(1),
    option(2),
    low(18),
    high(18),
    end of lt_table.
    DATA: ls_doc_id_range LIKE LINE OF lt_table.
    FIELD-SYMBOLS: <fs> LIKE LINE OF lt_table.
      ls_doc_id_range-sign = 'I'.
      ls_doc_id_range-option = 'BT'.
      ls_doc_id_range-low = lv_low.
      ls_doc_id_range-high = lv_high.
      INSERT ls_doc_id_range INTO TABLE lt_table.
    select matnr sernr into table lt_sernr
    from   zsd_upd_deldoc
    where  sernr >= lv_low and sernr <= lv_high.
      select matnr sernr into table lt_sernr
      from   zsd_upd_deldoc
      where  sernr in lt_table.
      loop at lt_sernr assigning <fs_sernr>.
        write: / <fs_sernr>-sernr.
      endloop.
    O/P
    9000010
    9000011
    900002
    900001
    9000010
    9000019
    9000019
    9000018
    9000017
    9000014
    9000018
    9000017
    Regards
    Vinayak Sapkal

  • Printing out char data type - unexpected results

    Hi, I have just started programming, and my first language is Java. I'm using JDK6 update 1.
    Scenario 1: - When I do System.out.println(string1 + string2); where string1 and string2 are String variables, the result is as expected.
    Scenario 2: - When I do System.out.println(string1 + char1); where string1 is a String variable and char1 is a char variable, here also the result is as expected.
    Scenario 3: - But when I do System.out.println(char1 + char2) the output is some numbers (I got output 22 when char 1 is 'P' and char2 is 'I').
    Could someone please explain scenario number 3? How do I achieve a concatenated output of multiple chars?
    Thanks.

    Thanks, so if I understand this right, the + operator works for Strings but is not meant for chars. When I think about it now, it seems right, because a char will always ever be only one character, and never more than one character.

  • Converting CHAR type to other data types

    Dear SDN users,
    would any of you know how to convert a CHAR data type to other data types for example hexadecimal etc., and convert them back? I suspect there must be some standard FMs available.
    Thankyou for your responses.
    Regards,
    Smitha

    Hello smitha ,
        I suppose you are assigning some  variable of char type to a variable of integer type it will automaticaly (implicitly ) convert the type .
    in some case we need to change the type explicitly like the above mentiioned .
    Thanks and regards ..
      Priyank

  • Dataelement of data type char but accepts only integers

    Hi Experts,
    I have a scenario where quantity field in output is editable and the user wants the quantity field printed without thousand separator. If i take a char field and display the field is editable then user may mistakenly type a,bcd...z/ special characters which it should not capture. Is there any char data type data element which accepts only integers. Because after that i need to save that value in z database table quantity field.
    Please share your suggestions.

    I have a scenario where quantity field in output is editable and the user wants the quantity field printed without thousand separator.
    I'm a bit lost with your statement, as you consider changing the data type it sounds like you have control over the program and thus most likely also over the forms (assuming that printing means sending some output to a printer). In that case I'd first consider keeping the quantity field as is and change the output logic (e.g. print program or form) so that the group (thousands) separator doesn't appear for that quantity field (and refrain from changing the field definition). (Similarly if it's just concerning the output of a field on the screen then an appropriate output mask/template for that screen field should be the right way to go.)

  • Changing data types of  fields in structures

    Hello,
       Currently we are working for upgrade to ECC 6.0 .
       In some transactions we are using BAPI_MATERIAL_SAVEDATA to create material.
      We have some additional fields in MARA and MARC table , which we fill using BAPI_TE_MARA and BAPI_TE_MARC structures.
        In these structures we have different data types for fields earlier in 4.6C
    Now this function module is only working if we change  data types of  fields in these structures only to char type. It is going for dump , if we maintain any other data type.
      Could any body tell me why should we change for char data type ?
    Regards,
      SATYA

    Hi,
    Check enhancement category (Extras --> Enhancement Category) for structures before enhancement. For example, for BAPI_TE_MARA structure, enhancement category is given as character type or numeric type. That means you can add the fields of data type only C and N. No other data types are allowed. If you select as not classified then you can add any data type. This option plays important role while enhancement.
    Regards,
    Prasanth

  • Data type determined at run time, how to provide the input type in advance

    Hi all,
    Here I have a requirement:
    on my UI, there is an inputfield which receives user's input. But the data type can't be known at design time.
    But I need to bind a context attribute to the inputfield first at design time, which data type should I use( the inputfield can recevie
    data of any type ) ?
    and how to convert the this data type into different data type( can be any type )?

    Hello Aaron,
    There can be a workaround for your requirement.
    you can assign a char data type to that field since Char can accept all characters, numbers, special symbols.
    But, you need to do validations later on the see if it is a number or all alphabets and accordingly you can assign that field to any data type  by doing little bit of manipulations.
    Hope this helps.
    Regards,
    Anand

Maybe you are looking for

  • How do I set up two libraries on one pc so that we have two separate libraries for each iPhone?

    How do I set up two libraries on one pc so that we have two separate libraries for each iPhone?

  • Add attachment in mail

    We have a workflow which triggers on PO creation/change , and sends a mail to the PR creator for which the PO has been created . We have a new requirement to add an attachment which contains the PO created in PDF form , in the mail sent to the PR. Ca

  • Getting error in upgrading from Sap 2005 to sap 8.8

    Hi everyone, I am upgrading my client from sap 2005 to sap 8.8.During the pre check wizard system is getting some error and creating the log file.The coming error is: Test result: Not completed due to SBOErr -2004 in function CDagCheckUTBRecordIncons

  • There are no functions containing returntype = 'query' and access!

    Hi there I am trying to add a recordset after defining a datasource and I keep getting the error when I do a CFC query search there are no functions containing returntype = 'query' and access!. I have attached an image to show the error messag I get.

  • Ejb module with dependecies

    Hi, I have an EJB module (a .jar) which has runtime dipendencies with a few other jars I have. How can I put all (EJB and dependencies) in one module (be it jar,ear, war or whatever)? At the moment I'm unjarring my dependences and then putting all to