4
Answers

Input string was not in a correct format

Ask a question
Sep

Sep

16y
15.8k
1

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)