Replacing values in a datatable

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm looking at some code where a column was added to a datatable and
then given
a value. It works fine. But if I try to update a previously existing
column,
it doesn't take. No error is thrown, it just doesn't get updated.
I've tried
a few variations, and I'm trying to avoid creating a new datatable.
An example of what works and what doesn't is shown below.
Any quick and easy solutions?


myDataTable.Columns.Add("Class",
System.Type.GetType("System.String"))
myDataTable.Columns("Class").AllowDBNull = True

For Each myDataRow In myDataTable.Rows
'OK
myDataRow("Class") = CType(myDataRow("CATG_NUM"),
String).Substring(0, 2)
'Not Ok -- it doesn't get updated
myDataRow("CATG_NUM") = myString
Next

.



Relevant Pages

  • Re: Samsung D600/D600e
    ... > Be safe, avoid orange's shit customisation of the software on the phone, ... Prev by Date: ...
    (uk.telecom.mobile)
  • Re: Process used by another
    ... > How could avoid that error?. ... > Kind Regards. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Send E-mail Only Can it be done?
    ... We do not want any POP stuff running or setup ... if we can avoid it, in fact if POP has to be set up then we will ... probably not explore this venture any further. ... Prev by Date: ...
    (comp.sys.ibm.as400.misc)
  • error trapping
    ... try and avoid this if posible ... John ... Prev by Date: ...
    (microsoft.public.excel.programming)