How to programatically create a DataRowView in ADO.NET
Posted on 2009-07-13
My problem is when I want to create a new row in a typed DataTable and edit it using DataBound WPF controls. Using the (typed) DataTable method: NewTABLERow() I can get a new instance of a typed datarow for TABLE. The particular database table I'm refering to has several columns that allow Null values.
When I bind, for example, a textbox to a Propery from the (Typed) DataRow that contains a Null value, an exception is thrown (StrongTypingException).
Instead of using the typed DataRow, if I used instead a DataRowView of the typed DataRow I should be ok, because no exception would be thrown... The problem is that I'm not finding a way of creating the DataRowView out of the typed DataRow...
Thanks in advance,