开发者

function import in entity framework error

hi i have an error in the entity framework. i imported the sp get() into EF and return results as complex datatype 'GetResult'.In the edmx xml i have set the 'Amount' type to decimal.

<ComplexType Name="Get_Result">
          <Property Type="String" Name="Description" Nullable="true" MaxLength="255" />
          <Property Type="Decimal" Name="Amount" Nullable="false" />
          <Property Type="Decimal" Name="Gst" Nullable="false" Precision="19" />
          <Property Type="Decimal" Name="Total" Nullable="true" Precision="19" />
        </ComplexType>

I try to bind the result with datagridview

gridview.DataSource = db.Get().ToList();

it kept giving me error message like this. and i couldn't find int32 开发者_Go百科anywhere in EF and have updated & built the EF multiple times.

The 'Amount' property on 'Get_Result' could not be set to a 'Int32' value. You must set this property to a non-null value of type 'Decimal'.

any help appreciated...


solved the issue by handling null exception

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜