title: Is it possible to load formula from excel file into grid view using c#?
body: <p><strong>Consider this example:</strong>
  I have an excel file in which I have data in two columns like below-</p>
  
  <pre><code>Salary  Commission  Net Payable
  1000        5             1050
  2000       10             2200
  3000       15             3450
  4000       20             4800
  </code></pre>
  
  <p>The formula used to calculate the Net Payable is : <code>A2+((A2*B2)/100)</code><br>
  Where <strong>A2 = Salary (here 1000)</strong>, and <strong>B2 = Commission (here 5)</strong><br>
  When I load these data from excel file into grid view, it only loads the values like above. 
  <strong>My question is: Is there any way so that I can load the internal formula also in grid view?</strong> Something like <strong>A2+((A2*B2)/100) in a grid view column</strong>?   Its not any development project. I just wonder if this could be done? Thanks.</p>
  
  <p><strong>Edit: The code I am using to load data</strong></p>
  
  <pre><code>try
          {
              rst = CMDExcel.ExecuteReader();
          }
          catch (Exception ex)
          {
              Interaction.MsgBox("Error in reading Operation data from excel file");
              return;
          }
  
          while (rst.Read())
          {
              sSalary = string.Empty;
              try
              {
                  sSalary = rst("Salary").ToString().Trim();
              }
              catch (Exception ex)
              {
              }
  
              if (sSalary.Length &gt; 0)
              {
                  DGMAIN.Rows.Add();
  
                  try
                  {
                      DGMAIN.Rows(i).Cells("DGMAIN_SALARY").Value = rst("Salary").ToString();
                  }
                  catch (Exception ex)
                  {
                  }
                  try
                  {
                      DGMAIN.Rows(i).Cells("DGMAIN_COMMISSION").Value = rst("Commission").ToString();
                  }
                  catch (Exception ex)
                  {
                  }
                  try
                  {
                      DGMAIN.Rows(i).Cells("DGMAIN_NET_PAYABLE").Value = rst("Net Payable").ToString();
                  }
                  catch (Exception ex)
                  {
                  }
  
                  i = i + 1;
              }
          }
          rst.Close();
  </code></pre>
  
  <p>There is no problem with the code as it loads data correctly into grid view.</p>