First, I'd suggest using EPPlus for managing those Excel files. You can get it via NuGet. Add a reference to OfficeOpenXml in your using statements.
So you'll want to read in those files one at a time, get the values from each worksheet, add to a list of objects, and run an INSERT statement against your SQL database. There are many ways to do this, but this is quick and dirty using ADO.NET and dynamics. Code sample assumes you're using a console application and Microsoft.NET 4.6.
Code below is not tested, just an example of how you might do this.
private static void ProcessFiles()
{
var directory = new DirectoryInfo(@"C:\MyFiles");
foreach (var file in directory.GetFiles("*.xslx"))
{
using (var package = new ExcelPackage(file))
{
var workSheet1 = package.Workbook.Worksheets[0];
var objectList = new List<dynamic>();
for (var x = workSheet1.Dimension.Start.Row; x <= workSheet1.Dimension.End.Row; x++)
{
dynamic objectToInsert = new ExpandoObject();
objectToInsert.Value1 = workSheet1.Cells[x, 0].Value;
objectToInsert.Value2 = workSheet1.Cells[x, 1].Value;
objectList.Add(objectToInsert);
}
using (var conn = new SqlConnection("MyConnectionString"))
{
foreach (var row in objectList)
{
using (var cmd = new SqlCommand($"INSERT INTO dbo.MyTable (Value1, Value2) VALUES ({row.Value1}, {row.Value2})", conn))
{
cmd.ExecuteNonQuery();
}
}
}
var workSheet2 = package.Workbook.Worksheets[1];
}
}
}