title: Embeding XLSX file into exe C#
body: <p>I wrote code in VS17 and that code uses a database stored in <code>xlsx</code> file (so far it was used by reading the path of the file and reading it using OLE.DB):</p>
  
  <pre><code>string DataBase_File = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory.ToString(), String.Format("{0}", db_name));
  
  string constr = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0 Xml;HDR=NO""", DataBase_File);
  using (OleDbConnection conn = new OleDbConnection(constr))
  {
      conn.Open();
      OleDbCommand command = new OleDbCommand(string.Format("Select * from [{0}]", SheetName), conn);
      OleDbDataReader reader = command.ExecuteReader();
  </code></pre>
  
  <p>When I want to compile it into <code>.exe</code> file I added the file into the resources in the following way:</p>
  
  <pre><code>var fileString = namespace.Properties.Resources.DataBase;
  </code></pre>
  
  <p>However, the result I get is that fileString is <code>{bytes[28432]}</code>.</p>
  
  <p>How can I make it a path or file that I can actually use the values in it cells as database?</p>
  
  <p>Thank you</p>