Using ASP .Net 4.0,Entity Framework and EntityDataSource.
I have some currency fields that are defined as Decimal. I would like to allow the user to enter a (leading) dollar sign in these (TextBox form fields). Although, when the EntityDataSource goes to save the changes to the datbase, it throws:
Error while setting property 'QuotedMaterial': 'Cannot convert the value of parameter 'QuotedMaterial' to the type 'System.Decimal'.'.
Does anyone know how I can "tell" the EF to allow dollar signs and convert (drop) them accordingly? I am trying to avoid creating my own Data or Business Logic layer for this particular application. I would like to stick with the EntityDataSource and other "built in" controls to minimize the C# code behind as much as possible.
I guess my only alternative is to deny $ (Dollar Signs) (and commas too for that mater, it doesn't like them either). The problem is I am porting a legacy application and I would like to keep it as close to the original as possible (and they are currently allowed to enter dollar signs in this application). You see, they use copy/paste for data entry quote often on this particular form and it just so happens that the source data (they are copy/pasting from) always has a $ in it...
View Complete Post