title: How to create borders to a data exported to excel from C# code?
body: <p>In using the following code to export the data into excel</p>
  
  <pre><code>OleDbDataAdapter insert = new OleDbDataAdapter();
  insert.InsertCommand = new OleDbCommand("INSERT INTO [" + DTabbleName + "$A3:" + strGet + "] (" + string.Join(",", colNames) + ") values (" + string.Join(",", colParms) + ")", conn);
  for (int i = 0; i &lt; DSreturn.Tables[0].Columns.Count; i++)
          {
              OleDbParameter param = new OleDbParameter();
              param.SourceColumn = DSreturn.Tables[0].Columns[i].ColumnName;
              param.ParameterName = DSreturn.Tables[0].Columns[i].ColumnName;
              param.Direction = ParameterDirection.Input;
              param.OleDbType = OleDbType.Char;
              param.Size = 255;
              insert.InsertCommand.Parameters.Add(param);
          }            
          insert.Update(DSreturn, DSreturn.Tables[0].TableName);
          if (conn.State == ConnectionState.Open)
              conn.Close();
  </code></pre>
  
  <p>How do i add borders to the exported excel only where data is available. Now i know that we can add the borders without any problem when we access the workbook sheet as below</p>
  
  <pre><code>sheet.Range["A1:E15"].Borders.LineStyle = LineStyleType.Double;
  sheet.Range["A1:E15"].Borders.Color = Color.DeepSkyBlue;
  </code></pre>
  
  <p>But how do we do this when using oledbadapter Update  function</p>