Search code examples
vb.netobjectdatarowdatacolumn

Is there a way to store a custom object in a DataRow or DataColumn?


Is there a way to store a custom object in a DataRow or DataColumn?

Basically I'm looking for the equivalent of a tag property for a DataRow or DataColumn. I looked into ExtendedProperties for the DataColumn but you can only store strings there.

drNewPathRow = dsOutputGrid.Tables("dtPathElements").Rows.Add()
   elm = pth.Elements(iElements)
   drNewPathRow(0) = elm.Name

    '  drNewPathRow.tag = elm .... I wish!

Solution

  • dt.Columns.Add("objCol", GetType(Object))
    

    I didn't know I could do this. Thanks the_lotus for your help.