There are a few ways to do just that.
Here is a simple implementation based on SQL Server CSV Import.
First generate a CSV file from your app and then import it into your SQLSERVER database.
To handle rows which aren't loaded into the table because of invalid data or format, could be handle using ERRORFILE property, specify the error file name, it will write the rows having error to error file. code could look like.
BULK INSERT MineralWaterTable
FROM 'C:\CSVData\mineralWaters.csv'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ',', --CSV field delimiter
ROWTERMINATOR = '\n', --Use to shift the control to next row
ERRORFILE = 'C:\CSVData\mineralWatersErrorRows.csv',
TABLOCK
)