para quienes tienen problema con esto... lo que me paso fue que la fila es de tipo entero y lo necesitaba de tipo texto... pero como el archivo viene tipo .csv
lei el archivo de texto y luego lo almacene aqui les dejo como hacerlo
Código vb:
Ver originalDim fName As String = ""
BuscarArchivo.InitialDirectory = "Desktop"
BuscarArchivo.Filter = "CSV files (*.csv)|*.CSV"
BuscarArchivo.FilterIndex = 2
BuscarArchivo.RestoreDirectory = True
If BuscarArchivo.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
fName = BuscarArchivo.FileName
'**** IMPORTAR DATOS CSV A DGV ****
Dim TextLine As String = ""
Dim SplitLine() As String
If System.IO.File.Exists(fName) = True Then
Dim objReader As New System.IO.StreamReader(fName)
Do While objReader.Peek() <> -1
TextLine = objReader.ReadLine()
SplitLine = Split(TextLine, ",")
Me.DGVCarga.Rows.Add(SplitLine)
Loop
'**** GUARDAR DATOS EN SQL *******
AbrirConexion()
For Each f As DataGridViewRow In DGVCarga.Rows
If filas < DGVCarga.Rows.Count - 1 Then
Using Comm As New SqlCommand(sql, Cone)
Comm.CommandText = "INSERT INTO [NSO].[dbo].[Audited_Facts_regular]([CountryID],[ContryName],[StoreID],[NSO_StoreID],[StoreName] " & _
" ,[StoreAddres] ,[StoreStatud],[StoreComments],[StoreStarDateTime],[StoreEndDateTime],[StoreClosing]" & _
" ,[PlannetAudit],[AuditInstructionID],[SyneryMode],[IMDB_ProductID],[NSO_ProductID],[ProductName]" & _
" ,[ProductCategory],[Barcode],[ProductLevel],[ProductComment],[LocationID],[LocationName],[LocationComments]" & _
" ,[ExhibitionID],[ExhibitionName],[ExhibitionLevel],[ExhibitionPossition],[ExhibitionComment],[VariableID]" & _
" ,[VariableName],[VariableAtribute],[VariableValue],[VariableComments],[FactType],[ReUser])" & _
"VALUES('" & f.Cells(0).Value.Replace(" ", "-") & "','" & f.Cells(1).Value.Replace(" ", "-") & "','" & f.Cells(2).Value & "','" & f.Cells(3).Value & "','" & f.Cells(4).Value.Replace("'", "´") _
& " ','" & f.Cells(5).Value.Replace(" ", "-") & "','" & f.Cells(6).Value.Replace(" ", "-") & "',' " & f.Cells(7).Value.Replace(" ", "-") & "','" & f.Cells(8).Value.Replace(" ", "-") _
& " ','" & f.Cells(9).Value.Replace(" ", "-") & "',' " & f.Cells(10).Value.Replace(" ", "-") & "','" & f.Cells(11).Value.Replace(" ", "-") & "','" & f.Cells(12).Value.Replace(" ", "-") _
& " ','" & f.Cells(13).Value.Replace(" ", "-") & "','" & f.Cells(14).Value.Replace(" ", "-") & "','" & f.Cells(15).Value.Replace(" ", "-") & "','" & f.Cells(16).Value.Replace(" ", "-") _
& " ','" & f.Cells(17).Value.Replace(" ", "-") & "','" & f.Cells(18).Value.Replace(" ", "-") & "','" & f.Cells(19).Value.Replace(" ", "-") & "',' " & f.Cells(20).Value.Replace(" ", "-") _
& " ','" & f.Cells(21).Value.Replace(" ", "-") & "','" & f.Cells(22).Value.Replace(" ", "-") & "','" & f.Cells(23).Value.Replace(" ", "-") & "','" & f.Cells(24).Value.Replace(" ", "-") _
& " ','" & f.Cells(25).Value.Replace(" ", "-") & "','" & f.Cells(26).Value.Replace(" ", "-") & "','" & f.Cells(27).Value.Replace(" ", "-") & "',' " & f.Cells(28).Value.Replace(" ", "-") _
& " ','" & f.Cells(26).Value.Replace(" ", "-") & "','" & f.Cells(30).Value.Replace(" ", "-") & "','" & f.Cells(31).Value.Replace(" ", "0") & "','" & f.Cells(32).Value.Replace(" ", "0") _
& " ','" & f.Cells(33).Value.Replace(" ", "-") & "','" & f.Cells(34).Value.Replace(" ", "-") & "','NULL')"
Comm.Connection = Cone
inserts = inserts + Comm.ExecuteNonQuery()
filas = filas + 1
End Using
End If
Next
End If
End If
FUNCIONA PERFECTAMENTE