Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7746609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:19:21+00:00 2026-06-01T10:19:21+00:00

I created a VB.Net application that will read from excel file and put the

  • 0

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:

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

thx in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:19:22+00:00Added an answer on June 1, 2026 at 10:19 am

    This is entirely normal. A program only doesn’t burn 100% core when it gets bogged down by I/O. Reading from a disk or network card, that blocks a program while the operating system supplies the data. Your code doesn’t bog down like that, you are asking it to do a bunch of work. Getting 195,000 cell values one by one just takes a while. Excel is an out-of-process COM server so every cell read requires two CPU context switches. You can optimize it a bit by using a Range instead. Or by running it on a machine with a two-core CPU so it only shoots up to 50%.

    Feature, not a bug.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a file named MyFile.db using SQLite3 from my C#.net application. This
I have created a new ActionFilter for an ASP.NET MVC application that I'm creating.
In a standard ASP.NET MVC template application that is created by default in Visual
I have created an SMS application in .NET. I wanted that the application should
I created MVC ASP.Net Web application and tried insert Thai language data to SQL
I need to create a .NET application that will store some confidential information to
I am having an ASP.NET Web application that i will deploy to an Internet
I'm building a very simple application .net Console Application that will execute a SQL
I have a .Net application that dynamically creates a small HTML page and pops
I have asp.net application. and I have created mobile version of it which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.