Write a default value within a given cell in C#

Asked

Viewed 45 times

0

I’m making a console application that reads data from a spreadsheet and compares it with values reported in the database. There is a default value, if a field of this worksheet is not filled in, I need to take the value of the database and set it in the worksheet in the cell that was not filled in. My difficulty is being how to set this value in this cell. I can do it in a new cell.

public class EscreverPlanilha {
    public void EscreveValorDefault(Campo campo, string column) {
        var str = new StringBuilder();
        str.Append(campo.ValorDefault);
    }
}
  • How are you accessing the spreadsheet? through open xml?

  • I am using the Streamreader <br> List<string> list = new List<string>(); Try { using (Streamreader Rd = new Streamreader(path)) { string line = null; while ((line = Rd.Readline()) != null) { list. Add(line.Tostring()); } Rd.Close(); Rd.Dispose(); Return list; } }

  • I think it is best to use Open XML. https://msdn.microsoft.com/pt-br/library/office/hh298534.aspx

1 answer

2


  • It worked out! Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.