title: Do we need to install Microsoft office in server for Excel import in Asp.net?
body: <p>do we need to install Microsoft office in server to run a application to import data from excel file to mssql database ?</p>
  
  <p>any suggestions or ideas ? </p>
  
  <p>the code i used</p>
  
  <pre><code>public partial class _Default : System.Web.UI.Page
  {
  private String strConnection = "Data Source=MYCBJ017550027;Initial Catalog=MySamplesDB;Integrated Security=True";
  protected void Page_Load(object sender, EventArgs e)
  {
  
  }
  protected void btnSend_Click(object sender, EventArgs e)
  {
  string path = fileuploadExcel.PostedFile.FileName;
  string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;Persist Security Info=False";
  OleDbConnection excelConnection =new OleDbConnection(excelConnectionString);
  OleDbCommand cmd = new OleDbCommand("Select [ID],[Name],[Designation] from [Sheet1$]",excelConnection);
  excelConnection.Open();
  OleDbDataReader dReader;
  dReader = cmd.ExecuteReader();
  SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection);
  sqlBulk.DestinationTableName = "Excel_table";
  sqlBulk.WriteToServer(dReader);
  excelConnection.Close();
  }
  }
  </code></pre>