title: [SqlException (0x80131904): String or binary data would be truncated thrown
body: <p>I'm getting a very vague error.  I have the following code:</p>
  
  <pre><code>var skey = ev.EntityKey;
  var id = skey.EntityKeyValues[0];
  int eventid = (int)id.Value;
  </code></pre>
  
  <p>The second line var id=skey.EntityKeyValues[0] throws the following exception:</p>
  
  <p>[SqlException (0x80131904): String or binary data would be truncated.
  The statement has been terminated.]</p>
  
  <p>Trouble is, EntityKeyValues[0] is code to get the primary key value of the newly inserted record and pass it to a method.</p>
  
  <p>It is a string but I don't see why it should be particuarly large. </p>