I'm trying to add a column into a dataset and copy a part of an other datarow into the new made column like this:
VB Code:
  1. Dim DsTemp As DataSet
  2.         Dim myConnection As Odbc.OdbcConnection
  3.         Dim ConnectieString As String
  4.         Dim myDataRowsCommandBuilder As Odbc.OdbcCommandBuilder
  5.  
  6.  
  7.         myConnection = New Odbc.OdbcConnection(GetDatabaseConn) 'get's the connectionstring from an other public place
  8.         ConnectieString = "SELECT * FROM Humans"        
  9.         mySqlDataAdapter = New Odbc.OdbcDataAdapter(ConnectieString, myConnection)
  10.         DsTemp = New DataSet
  11.         myDataRowsCommandBuilder = New Odbc.OdbcCommandBuilder(mySqlDataAdapter)
  12.         mySqlDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
  13.         mySqlDataAdapter.Fill(DsTemp, "Humans")
  14.         myConnection.Close()
  15.  
  16.         Dim Drow As DataRow
  17.  
  18.         If DsTemp.Tables(0).Columns("Activity") Is Nothing Then
  19.             Dim DC As DataColumn = New DataColumn("Activity")
  20.             DC.DataType = System.Type.GetType("System.Int32")
  21.             DsTemp.Tables(0).Columns.Add(DC)
  22.         End If
  23.  
  24.         For Each Drow In DsTemp.Tables(0).Rows
  25.             If Len(Drow!projectnr) > 10 Then
  26.                 Drow!Activity = Val(Mid(Drow!Projectnr, 12))
  27.                 Drow!Projectnr = Mid(Drow!Projectnr, 1, 10)                
  28.             End If
  29.         Next
  30.  
  31.         Try
  32.             mySqlDataAdapter.Update(DsTemp, "Humans")
  33.         Catch ex As Exception
  34.             MsgBox(ex.Message)
  35.         End Try

But in the end the Projectnr column has been updated with the Mid(Drow!Projectnr, 1, 10) but..
There is no column with the name Activity????
Does anyone know what I'm doing wrong here?