Question

I'm new to silverlight and therefore data access in silverlight so bear with me. I have an ADO.Net entity data model referencing a sql server 2008 database. The table causing problems is called transaction. The transaction table has a non-nullable field "MerchantChain". This table is populated by another program that inserts empty strings into the merchantchain field when a merchant chain is not supplied. So in my silverlight app I load a grid with transactions based on criteria supplied by the user. The grid is for display only, but I need to be able to update the status of a transaction after a user views it. So I set the transaction.status field and attempt a submitchanges. Before submitchanges, the transaction.HasValidationErrors is false. As soon as the submitchanges is executed (in the debugger) the HasValidationErrors is true and the submit throws an unhandled exception. The ValidationError is that the merchantchain field is required. Well, its an empty string - its not null. No idea what to do. This is visual studio 2010, silverlight 4, vb.net.

Was it helpful?

Solution

[Required(AllowEmptyString = true)]

You need to make the empty string allowed. Go to your buddy class and add this. More detail can be found here:

http://forums.silverlight.net/forums/p/176631/398676.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top