title: Error : String or binary data would be truncated. The data for table-valued parameter doesn't conform to the table type of the parameter
body: <p>I am getting error</p>
  
  <blockquote>
    <p>String or binary data would be truncated. The data for table-valued parameter doesn't conform to the table type of the parameter.The statement has been terminated.</p>
  </blockquote>
  
  <p>Stored procedure is:</p>
  
  <pre><code>CreatePROCEDURE [dbo].[addquestion] 
       @dt as MyDataTable readonly
  AS
  BEGIN
      insert into questiontbl(Question)
          select(Question) 
          from @dt;
  END
  </code></pre>
  
  <p>The table is:</p>
  
  <pre><code>CREATE TABLE [dbo].[questiontbl]
  ( 
    [checkval] [varchar](max) NULL, 
    [Question] [varchar](max) NULL 
  ) 
  </code></pre>
  
  <p>C# code:</p>
  
  <pre><code>con.Close();
  con.Open();
  
  DataTable sqa = Session["questionlist"] as DataTable;
  
  SqlParameter tvparam = cmd.Parameters.AddWithValue("@dt", sqa);                
  tvparam.SqlDbType = SqlDbType.Structured;
  
  cmd.ExecuteNonQuery();
  </code></pre>
  
  <p><code>Cmd.ExecuteNonQuery()</code> returns the error mentioned. I have matched the datatype - it is <code>varchar(max)</code> in type and table as well.</p>