Note that there are some explanatory texts on larger screens.

plurals
  1. POCPU usage goes to 100% while reading from excel file?
    primarykey
    data
    text
    <p>I created a VB.Net application that will read from excel file and put the data into a table. I used an excel sheet which has 3 columns and 65000 rows. Before starts reading the excel my machine's CPU Usage is around 15%, but during reading the CPU Usage jumps upto 95%. I don't know why it is happening? Can someone help me in this issue? The following is the code i'd written:</p> <pre><code>Private Sub readFromExcel(ByVal fileName As String, ByVal sheetName As String) Dim connString As String = "data source=XE; user=test; password=test" Dim con As New OracleConnection(connString) Dim str1 As String Dim str2 As String Dim str3 As String Dim xlApp As Excel.Application Dim xlWorkBook As Excel.Workbook Dim xlWorkSheet As Excel.Worksheet xlApp = New Excel.ApplicationClass xlWorkBook = xlApp.Workbooks.Open(fileName) xlWorkSheet = xlWorkBook.Worksheets(sheetName) Dim x As Integer Dim y As Integer Dim i As Integer x = xlWorkSheet.Rows.Count() y = xlWorkSheet.Columns.Count() Try For i = 1 To x - 1 'MsgBox(xlWorkSheet.Cells(i, 0).value) str1 = xlWorkSheet.Cells(i, 1).value str2 = xlWorkSheet.Cells(i, 2).value str3 = xlWorkSheet.Cells(i, 3).value insertData() Next Catch ex As Exception MsgBox(ex.Message()) Finally con.Close() xlWorkBook.Close() End Try End Sub Private Sub insertData() Dim str As String str = "insert into test_import values('" + str1 + "'," + str2 + "," + str3 + ")" Dim cmd As New OracleCommand() cmd.CommandText = str cmd.Connection = con cmd.ExecuteNonQuery() End Sub </code></pre> <p>thx in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload