Good morning, friends!
I need some help.
I'm doing a "Select" from an Excel spreadsheet in VB.Net to import the data into the bank however a column is not bringing the data properly. This column has both numbers as * 's; when they are numbers it brings the values, but when they are 's (, , * , ****) brings {}, I would like the whole column to return as String. Is it possible?
- Method that imports spreadsheet
Dim dtbSheet As New DataTable
Dim wrkConnectionString As String = String.Format(CONNECTION_STRING_OLEDB_EXCEL, pPathFile)
Dim wrkSQL As String = String.Format("SELECT * FROM [{0}$]", pSheet)
'Intancia conexão
Dim wrkConnection As OleDbConnection = Nothing
Dim wrkCmd As OleDbCommand = Nothing
Dim wrkDa As OleDbDataAdapter = Nothing
Try
wrkConnection = New OleDbConnection(wrkConnectionString)
wrkCmd = New OleDbCommand(wrkSQL, wrkConnection)
wrkDa = New OleDbDataAdapter(wrkCmd)
wrkDa.Fill(dtbSheet)
Finally
If wrkConnection IsNot Nothing AndAlso wrkConnection.State = ConnectionState.Open Then wrkConnection.Close()
End Try
Return dtbSheet
- Column example