It doesn't matter whether it's in an extension method, or any method. The DataRow
constructor is not publicly accessible. You need to use the DataTable.NewRow()
method to create a new DataRow
.
It will use the schema information from the data table to create a row that matches it. If you just tried to use the constructor on it's own the object would have no idea what schema should be used.