Hi santosgernan1,
You need to allow NULL in your database table column for saving NULL value when no file is selected in the FileUpload control.
Refer below sample.
Database
I have created the sample using the following table name EmployeeData with the schema as follows.

CREATE TABLE EmployeeData
(
IDNo INT IDENTITY PRIMARY KEY,
EmpName VARCHAR(50) NULL,
Photo VARCHAR(100) NULL,
MarkSheet VARCHAR(100) NULL
)
Namespaces
using System.IO;
using System.Data.SqlClient;
using System.Configuration;
Controller
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Index(string name, HttpPostedFileBase image1, HttpPostedFileBase image2)
{
string img1 = null;
string img2 = null;
if (image1 != null)
{
img1 = Path.Combine("~/Files/Photos/", Path.GetFileName(image1.FileName));
image1.SaveAs(Server.MapPath(img1));
}
if (image2 != null)
{
img2 = Path.Combine("~/Files/Marksheets/", Path.GetFileName(image2.FileName));
image2.SaveAs(Server.MapPath(img2));
}
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
string spName = "INSERT INTO EmployeeData VALUES (@Name, @Photo, @Marksheet)";
using (SqlCommand cmd = new SqlCommand(spName, con))
{
cmd.Parameters.AddWithValue("@Name", name);
cmd.Parameters.AddWithValue("@Photo", img1 != null ? img1 : (object)DBNull.Value);
cmd.Parameters.AddWithValue("@Marksheet", img2 != null ? img2 : (object)DBNull.Value);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
return View();
}
}
View
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<table>
<tr>
<td><span>Name:</span></td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td><span>Photo:</span></td>
<td><input type="file" name="image1" /></td>
</tr>
<tr>
<td><span>Marksheet:</span></td>
<td><input type="file" name="image2" /></td>
</tr>
</table>
<br />
<input type="submit" value="Upload" />
}
</body>
</html>
Screenshot
