You need to check some condition in InsertRecord method like below.
public static void InsertRecord(ProjectProfile model)
{
// ..... my starting coding ...
if (model.builder_id == 0)
{
cmd.Parameters.AddWithValue("@build_id", DBNull.Value);
}
else
{
cmd.Parameters.AddWithValue("@build_id", model.builder_id);
}
// ..... my end coding ...
}
Please refer the logic and implement it in your project. You can also refer this Reply In the same question.