Sorry with my English
I have an input file where the user will upload an Excel File, 1st I need to scan the extension of the file (.xlsx or .xls), after reading data from it and save the data in SQL Server.
Abour scan a extension I have this:
var ext = Path.GetExtension(file.FileName);
var allowedExtensions = new[] { ".xlsx", ".xls" };
if(allowedExtensions.Contains(ext)){ //codigo }
Now, my biggest question is to read the file data and send it to SQL Server.
The table has these columns:
ID
Registro
Nome
Ativo
I'm a newbie in the area, if that's simple, sorry :)