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 8001351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:04:20+00:00 2026-06-04T16:04:20+00:00

In my requirement, I am successfull in opening & reading Excel(both 2003 & 07)

  • 0

In my requirement, I am successfull in opening & reading Excel(both 2003 & 07) data from Asp.net OLEDB.

But it works only when Excel Sheet Kept open in our PC , Otherwise it gives ‘External Table format error’ .What exactly the problem ?.Can anyone show me light please. Is this anything problem with access rights?

Am sure Its nothing to do with connection string . My code

protected void Page_Load(object sender, EventArgs e)
        {
            string path = @"C:\Users\abcd\Desktop\raj.xls";
            connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + absoluteDir + ";Extended Properties=\"Excel 8.0;HDR=YES;\"";

            OleDbConnection oledbConn = new OleDbConnection(connStr);
            try
            {

                oledbConn.Open();
                OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
                OleDbDataAdapter oleda = new OleDbDataAdapter();
                oleda.SelectCommand = cmd;
                DataSet ds = new DataSet();
                oleda.Fill(ds);
                GridView1.DataSource = ds.Tables[0].DefaultView;
                GridView1.DataBind();
            }
            catch (Exception err)
            {

            }
            finally
            {
                // Close connection
                oledbConn.Close();
            } 
        }

Thanks 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-04T16:04:21+00:00Added an answer on June 4, 2026 at 4:04 pm

    Problem is with access problem .that mean sheet was password protected.

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

Sidebar

Related Questions

Requirement is like: I want to take input values from user in frame but
I have a web application that has a requirement to take data from an
My requirement is to create a framework that can consume standard ASP.NET Profile provider.
I have an requirement of store and retrieve data from isolated storage file.I will
the below code works fine but my requirement is little different then what it
My requirement is the following: From my ASPX page I import data from a
My requirement is to use 2 tables and 1 chart to visualize my data
Current requirement is on button click I am getting a json data through ajax
my requirement is print the multiple selection data in dropdown list. i tried this
Requirement: Requirement is to pull (execute()) a set of data sources. The pulls are

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.