Sep

Sep

  • NA
  • 5.5k
  • 0

Input string was not in a correct format

Jul 2 2008 6:14 PM

Hi,

Please help me I really don’t know what to do…

Here is my code.

 

Function ROWS(ByVal dt As DataTable, ByVal dtNew As DataTable) As DataRow

        Dim workRow As DataRow

        Dim i As Integer

        Try

            workRow = dtNew.NewRow()

            For i = 0 To 39

                workRow(i) = dt.Rows(0).Item(i).ToString

            Next

        Catch ex As Exception

            MsgBox(ex.ToString)

        End Try

        Return (workRow)

 

    End Function

dt comes from CSV files.I just want to add new row to this datatable from other datatable(dtNew) which has only one row.

This is the error that I get:

Input string was not in a correct format.Couldn't store <z-code> in F16 Column.  Expected type is Int32.

 

What should I do??????

 


Answers (4)