title: LINQ delete error (C#)
body: <pre><code>/// &lt;summary&gt;
  /// Deletes all data records associated with a data record ID
  /// &lt;/summary&gt;
  /// &lt;param name="DataID"&gt;Data ID record&lt;/param&gt;
  public static void DeleteDataLabels(int DataId)
  {
      using (var dc = new ArtworkingDataContext())
      {
          // Delete associated datalabels
          var q = dc.tblArtworkDataLabels.Where(c =&gt; c.dataID == DataId);
  
          if (q.Count() != 0)
          {
              dc.tblArtworkDataLabels.DeleteAllOnSubmit(q);
              dc.SubmitChanges();
          }
      }
  }
  </code></pre>
  
  <p>If there are records to delete in the DB, it throws:</p>
  
  <blockquote>
    <p>Exception Details:
    System.Data.SqlClient.SqlException:
    The text, ntext, and image data types
    cannot be compared or sorted, except
    when using IS NULL or LIKE operator.</p>
  </blockquote>
  
  <p>On</p>
  
  <p><code>dc.SubmitChanges();</code></p>
  
  <p>Bit confused about this one!</p>