title: Get data from the excel file using c# asp.net
body: <p>I am trying to load data using following code.</p>
  
  <pre><code>string path = System.IO.Path.GetFullPath(uploadExcelFile.PostedFile.FileName);
              string connString = "provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Rizwan shahid\\Desktop\\DataUpload\\Req.xls;Extended Properties=Excel 12.0;";
              OleDbConnection oledbConn = new OleDbConnection(connString);
              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, "Table");
                  return ds.Tables[0];
              }
              catch
              {
                  return null;
              }
              finally
              {
                  oledbConn.Close();
              }
  </code></pre>
  
  <p>It was working on 32Bit operating system but when run this code on 64Bit OS it gives the following error</p>
  
  <pre><code>The Microsoft Access database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly. If 'Sheet1$' is not a local object, check your network connection or contact the server administrator.
  </code></pre>
  
  <p>I am running VS in Administrator mode and found many solution like replace Sheet1 with file name or place file in C drive but still getting the same error.</p>