Saturday, September 27, 2008

Why I got NullReferenceException when using DataView.AddNew()?

DataView dv = new DataView();
DataRowView drv = dv.AddNew(); // throw NullReferenceException

If you create a DataView using the constructor that does not take any arguments, you will not be able to use the DataView until you have set the Table property.

No comments: