Vedavyas Velaga Ответов: 1

Один пробел добавляется в конце при вставке данных в БД?


While inserting data into a table using .Net entity framework stored procedure call a white space is appending at the end. this issue is with two columns only.
where both the columns are having a Foreign Key to different tables (the tables will have allowable values (constants)). 
FYI.

 1. column 1 is defined as varchar(6) and column 2 is defined varchar (3) in sql DB.
 2. but the foreign  key table 1 is having data with max length is 4, table 2 is having data with max length is 3.
 3.  in EDMX file below code is available 

a) 

    <Function Name="spInsertdetails" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
            <Parameter Name="column1" Type="char" Mode="In" />
            <Parameter Name="column2" Type="char" Mode="In" />
    
    b) <FunctionImport Name="spInsertdetails" ReturnType="Collection(TestDBModel.spInsertdetails_Result)">
                <Parameter Name="column1" Mode="In" Type="String" />
                <Parameter Name="column2" Mode="In" Type="String" />

Please let me know if any further details required.


Что я уже пробовал:

in 3.a) i have tried changing the char to varchar but the issue still present.

1 Ответов

Рейтинг:
0

Vedavyas Velaga

We need to change datatype to varchar in both Stored procedure as well in entity framework edmx, then in 3)a Function it will change to varchar, so it will not append space at the end.