Peculiar problem
<p>Let's say I have a DataTable:</p>

<pre><code>DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Country", typeof(string)));
dt.Columns.Add(new DataColumn("State", typeof(string)));
</code></pre>

<p>Now I populate it</p>

<pre><code>DataRow dn = dt.NewRow();
dn["Country"] = "1";
dn["State"] == "2";

// Add it
dt.Rows.Add(dn);
</code></pre>

<p>That works fine. Now if Country and State are zero, I don't want it to add to the table. For example:</p>

<pre><code>dn["Country"] = "0";
dn["State"] = "0";

if (dn["Country"].ToString() != "0" &amp;&amp;
    dn["State"].ToString() != "0")
   dt.Rows.Add(dn);
</code></pre>

<p>That doesn't work. What am I doing wrong there? I've tried setting type to int and that didn't help much either...</p>

<p>Thanks,
Jim</p>

<p><strong>Update</strong>:</p>

<p>This is more like what I'm doing:</p>

<pre><code>dn["Country"] = (from c in db.Country where c.Zone == 3 select c.Code).Count();
</code></pre>

<p>Now if that were to return Zero, the row should not be added to the DataTable. What instead happens is that if the count is greater than 0, its not added either.</p>

<p><strong>Update 2</strong></p>

<p>Got it to work with Any() for now, as suggested by Jon Skeet below. Thanks everyone!</p>
