Working with Excel data in C #

5

I need to create an application that reads a small sequence of data available each in an Excel column. My question is if the best way is to treat SQL directly by uploading the file and then dealing with a procedure or working with the data in C # and sending them to each column of my SQL table.

In dealing with the C # side, I believe I can be more confident about what I am sending to the bank, I read about this: #

For the procedure example I'm using this article as a base: link

    
asked by anonymous 01.07.2014 / 15:51

1 answer

2

Business rules are not recommended in the database! Just for this reason the ideal would be you to use C #.

I recommend the library: LinqToExcel

You can read Excel files very intuitively:

var excel = new ExcelQueryFactory("excelFileName");
var indianaCompanies = from c in excel.Worksheet<Company>()
                       where c.State == "IN"
                       select c;
    
04.07.2014 / 20:23