VB.net "System.Data.ConstraintException: This property cannot be set to a null value. " Error
<p>I am working with VB.</p>

<p>I have two tables that I am working with.  <strong>PurchaseOrderTrackings</strong> and <strong>PODestinations</strong>.
PODestinations has a foreign key referencing PurchaseOrderTrackings.</p>

<p>I am trying to select a record to update it, with the following code:</p>

<pre><code>Dim updateRec As SoleWebCore.PODestinations = (From i In db.PODestinations Where i.PurchaseOrderTrackings.PO = txtPO.Text Select i).Single
</code></pre>

<p>when I run the debugger when I get to this line of code an error is thrown on line 8054 in the designer.vb file of my edmx.</p>

<p><strong>Exception Details</strong>: System.Data.ConstraintException: This property cannot be set to a null value</p>

<p>Line 8052:            OnModelChanging(value)</p>

<p>Line 8053:            ReportPropertyChanging("Model")</p>

<p>Line 8054:            _Model = StructuralObject.SetValidValue(value, false)</p>

<p>Line 8055:            ReportPropertyChanged("Model")</p>

<p>Line 8056:            OnModelChanged()</p>

<p>Not really sure why this is happening. Any help would be appreciated. Thanks.</p>
