title: TVP does not conform to table type
body: <p>Below is the function that inserts my data.</p>
  
  <pre><code>                using (SqlCommand insSwipeDataCommand = connection.CreateCommand())
                  {
                      insSwipeDataCommand.Transaction = transaction;
                      insSwipeDataCommand.CommandType = CommandType.StoredProcedure;
                      insSwipeDataCommand.CommandText = "dbo.insSwipeData_sp";
  
                      SqlParameter attendeeTableParam = insSwipeDataCommand.Parameters.Add("@AttendeeTable", SqlDbType.Structured);
                      attendeeTableParam.Value = this.dataTable;
                      attendeeTableParam.TypeName = "AttendeeTableType";
  
                      // add orgid parameter
                      insSwipeDataCommand.Parameters.Add("@orgId", SqlDbType.UniqueIdentifier).Value = this.organizationId;
                      insSwipeDataCommand.ExecuteNonQuery();
                  }
  </code></pre>
  
  <p><strong>insSwipeData_sp</strong></p>
  
  <pre><code>create PROC dbo.insSwipeData_sp
  (@AttendeeTable         AttendeeTableType READONLY
  ,@orgId                 UNIQUEIDENTIFIER
  )
  
  AS
  
  BEGIN
      SET NOCOUNT ON
  
  
      DECLARE @enteredUserId  UNIQUEIDENTIFIER
      SET @enteredUserId = 'xxxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx'
  
      -- Delete old Swipe records
      DELETE FROM dbo.swipeData_tbl
      WHERE orgId = @orgId
  
      -- CREATE Swipe Records
      INSERT INTO dbo.swipeData_tbl
      (orgId, sdid, rawData, enteredUserId, enteredUtc, manualEntry)
      SELECT @orgId, attendeeId, barcode
            ,@enteredUserId, GETUTCDATE(), 0 -- Consider ( datepart , date ) if date here is needed as NVARCHAR
      FROM @AttendeeTable
      WHERE barcode IS NOT NULL and LTRIM(RTRIM(barcode)) &lt;&gt; '';
  END
  </code></pre>
  
  <p>Here is an image of my <code>AttendeeTableType</code> schema.
  <img src="https://i.stack.imgur.com/AC4bD.png" alt="enter image description here"></p>
  
  <p>and here is an image of my <code>this.datatable</code> that i am using for my <code>attendeeTableParam</code>
  <img src="https://i.stack.imgur.com/jhl36.png" alt="enter image description here">
  On the <code>insSwipeDataCommand.ExecuteNonQuery();</code> line i get the following error.</p>
  
  <p><em>The data for table-valued parameter "@AttendeeTable" doesn't conform to the table type of the parameter.</em></p>