I have a dataset that I'm working with that will sit in memory for as long as the user has the program running. Let's say there's a column in this dataset whose values will change as the user works, and at some point the user decides to restart everything. The way I am currently resetting the particular column in the dataset is:
dsDataSet.Tables("TableName").Columns.Remove("ColumnName")
...and then re-adding the column (default values are OK for my purposes). Is this the "right" way to clear a table column in a dataset or is there a better/more accepted way? While there's a .Clear method for tables, there isn't one for columns.
Hmm, maybe this is "cleaner":
Code:Dim objSelectedRows() As DataRow objSelectedRows = dsDataSet.Tables("TableName").Select("Value <> 0") For Each objRow In objSelectedRows objRow("Value") = 0 Next




Reply With Quote