So I would like to extend the DataRow
class by adding int to the class Obviously it is simple
public class DataRowWithInt : DataRow
{
// Properties ///////////////////////////////////////////////////
public int integer
{
get;
set;
}
// Constructor //////////////////////////////////////////////////
public DataRowWithInt(DataRowBuilder builder)
: base(builder)
{
}
}
Now when you want to create new row you would have to call
DataTable intDataTable = new DataTable();
intDataTable.Columns.Add("temp");
DataRowWithInt row = intDataTable.NewRow();
But this gives you conversion error. How can I avoid this problem and get DataRowWithInt
to intDataTable
?
Thank you.
-- edit --
I am aware that DataTable class is not going to return me DataRowWithIn. I would like to create an inherited DataTable class but I do not know what to write on NewRow class