title: operand type clash: int is incompatible with utblProgramAllotment[user defined table type]
body: <p>My C# code:</p>
  
  <pre><code>var Message = new SqlParameter("Message", SqlDbType.VarChar, 8000);
  
  Message.Direction = ParameterDirection.Output;
  
  var UserId = new SqlParameter("UserId ", SqlDbType.BigInt);
  UserId.Value = Convert.ToInt64(System.Web.HttpContext.Current.Session["UserIDKey"]);
  
  var utblProgramAllotment = new SqlParameter("utblProgramAllotment", SqlDbType.Structured);
  utblProgramAllotment.Value = dtProgrammeAllotments;
  utblProgramAllotment.TypeName = "dbo.utblProgramAllotment";
  
  try
  {
      db.Database.ExecuteSqlCommand(
           "exec uspInsertUpdateProgrammeAllotment    @UserId , @utblProgramAllotment, @Message OUTPUT",
           UserId, utblProgramAllotment, Message);
  }
  catch (Exception ex)
  {
      vm.Message = ex.Message.ToString();
      Errorlog.WriteErrorlog(ex, "Programme Allotment", "");
  </code></pre>
  
  <p>and my procedure accepts:</p>
  
  <pre><code>ALTER PROCEDURE   [dbo].[uspInsertUpdateProgrammeAllotment] 
  (      
      @utblProgramAllotment AS utblProgramAllotment READONLY,
      @UserId Bigint,
     @Message VARCHAR(8000) OUTPUT    
  )
  </code></pre>
  
  <p>And the user defined table type is</p>
  
  <pre><code>CREATE TYPE [dbo].[utblProgramAllotment] AS TABLE(
      [ProgrammeScheduleIDKey] [bigint] NOT NULL,
      [ProposalDetailsIDKey] [bigint] NOT NULL,
      [SanctionOrderIDKey] [bigint] NOT NULL,
      [ProgrammeIDKey] [bigint] NOT NULL,
      [EmployeeIDKey] [bigint] NOT NULL,
      [DistrictIDKey] [bigint] NOT NULL,
      [TargetGroupIDKey] [bigint] NOT NULL,
      [ProgrammeTitleIDKey] [bigint] NOT NULL,
      [ProgramMode] [varchar](3) NOT NULL,
      [ProgrammeDescription] [varchar](500) NOT NULL,
      [ScheduleStartDateDt] [datetime] NULL,
      [ApprovalDt] [datetime] NOT NULL,
      [ScheduleEndDateDt] [datetime] NULL,
      [ProgrammeVenue] [varchar](250) NOT NULL,
      [NoofParticipants] [bigint] NOT NULL,
      [Remarks] [varchar](500) NOT NULL,
      [AccountsRemarks] [varchar](250) NOT NULL,
      [ExamDateDt] [datetime] NULL,
      [ProgrammeTitle] [varchar](250) NOT NULL,
      [DeletedFlg] [bit] NOT NULL
  )
  </code></pre>
  
  <p>I am sending a data table to a sql stored procedure.
  When I try to pass this data table from my c# it shows an exception as 
  <strong>operand type clash: int is incompatible with utblProgramAllotment this is user defined table type</strong>  </p>