You can set a loop to store the names of the files in the SQL database. For example, if the images come from a request, you would possibly write this code.
foreach (var file in Request.Files) {
var filename = file.FileName;
var command = "INSERT INTO table_name (FileName) VALUES (@0)";
}
I have not written any code for the execution, because it depends on whether you're using the Database object of WebMatrix.Data or you're using the SqlClient object.
Edit
Since you're using SqlClient, you can use the
SqlCommand[
^] and execute it. The result would be the number of rows affected (created in the case of INSERT INTO).