Insert Null value In DB
<p>I need to insert NULL value when I donot upload image .I tried to do that but I find  insert in table .Please any one help me</p>

<p></p>

<pre><code>protected void BtnSubmit_Click(object sender, EventArgs e)
{
        int RowAffected = 0;
        byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength];
        HttpPostedFile uploadedImage = FileUpload1.PostedFile;
        uploadedImage.InputStream.Read
               (imageSize, 0, (int)FileUpload1.PostedFile.ContentLength);


        using (SqlConnection con = Connection.GetConnection())
        {
            SqlCommand Com = new SqlCommand("Insert_IntoModel", con);
            Com.CommandType = CommandType.StoredProcedure;

            SqlParameter UploadedImage = new SqlParameter
                              ("@Image", SqlDbType.VarBinary, imageSize.Length);
            UploadedImage.Value = imageSize;
            Com.Parameters.Add(UploadedImage);
            if (FU2.PostedFile == null &amp;&amp; FU2.PostedFile.FileName == "")
            {

                Com.Parameters.Add("@Logo", SqlDbType.VarBinary).Value = DBNull.Value;
            }
            else
            {
                byte[] imageSize2 = new byte[FU2.PostedFile.ContentLength];
                HttpPostedFile uploadedImage2 = FU2.PostedFile;
                uploadedImage2.InputStream.Read
                           (imageSize2, 0, (int)FU2.PostedFile.ContentLength);

                SqlParameter UploadedImage2 = new SqlParameter
                              ("@Logo", SqlDbType.VarBinary, imageSize2.Length);
                UploadedImage2.Value = imageSize2;
                Com.Parameters.Add(UploadedImage2);
            }
            RowAffected = Com.ExecuteNonQuery();
            if (RowAffected &gt; 0)
            {
                LblResult.Visible = true;
                LblResult.Text = "Successfully Proccess";
                Tbl.Visible = false;
            }
        }

    }
}
</code></pre>
