How to derive a class from DataRow?

L

Lei Jiang

It seems a DataRow can only be created from
DataTable.NewRow()/NewRowArray()/NewRowFromBuilder() method. If I want to
derive a class from DataRow, how can I create it?

In MSDN, the NewRowFromBuilder() seems could do this, but the method is
marked as internal use.
 
M

Miha Markic [MVP C#]

Hi Lei,

I doubt that you'll be able to create a derived row.
You could use reflection but that involves hacking the code.
What are you trying to achieve?
 
L

Lei Jiang

Thank you for your reply. I have solved this problem. Please refer to
DataTable.GetRowType and DataTable.OnTableNewRow methods you will know how
to do that.

Miha Markic said:
Hi Lei,

I doubt that you'll be able to create a derived row.
You could use reflection but that involves hacking the code.
What are you trying to achieve?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Lei Jiang said:
It seems a DataRow can only be created from
DataTable.NewRow()/NewRowArray()/NewRowFromBuilder() method. If I want to
derive a class from DataRow, how can I create it?

In MSDN, the NewRowFromBuilder() seems could do this, but the method is
marked as internal use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top