Monday, March 12, 2012

would like to add new row to existing DataTable

I am trying to add a new row for ever record that is in the existing table. The row I want to add is called "Css". The purpose of adding this row is to grab the value from the list and display the stylesheet name as needed. Each record would be a different style sheet.

Whats the best way to approach this?

Ive tried adding new rows but keep getting this error: "This row already belongs to this table."

Thoughts?dt.Columns.Add("TDCssClass", System.Type.GetType("System.String"))
dt.Columns.Add("Width", System.Type.GetType("System.String"))

'add the items
.Item("TDCssClass") = "Somevalue"
.Item("Width") = "SomeValue"

0 comments:

Post a Comment