title: Assigning null values to SqlParameter DateTime
body: <p>I have a table like this</p>
  
  <pre><code>CREATE TABLE [dbo].[tblVolunteers]
  (
      [VolID] [int] IDENTITY(1,1) NOT NULL,
      [VolFName] [varchar](20) NULL,
  
      [DLExpiration] [smalldatetime] NULL,
  
      CONSTRAINT [PK_tblVolunteers] PRIMARY KEY CLUSTERED 
      ([VolID] ASC),
      CONSTRAINT [uniqueUserID] UNIQUE NONCLUSTERED ([UserID] ASC)
  ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  GO
  </code></pre>
  
  <p>And I have a stored procedure to update data on this table</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[volUpdate]
      @StaffID INT,
      @ModifiedBy VARCHAR(100),
      @NickName VARCHAR(20),
      @FirstName VARCHAR(20), 
      @DLExpiration SMALLDATETIME
  AS
      UPDATE tblVolunteers 
      SET
          VolNickName = @NickName, 
          VolFName = @FirstName, 
          DLExpiration = @DLExpiration
      WHERE 
          VolID = @StaffID
  </code></pre>
  
  <p>In some cases I don't have a valid <code>DLExpiration</code> to update at that time I want to pass null value to table. And I am doing it like this</p>
  
  <pre><code>new SqlParameter("@DLExpiration", null)
  </code></pre>
  
  <p>But still it throws an error</p>
  
  <blockquote>
    <p>Procedure or function 'volUpdate' expects parameter '@DLExpiration', which was not supplied.</p>
  </blockquote>
  
  <p>Can anyone point out What I am doing wrong here?</p>