make acondition on sql database table
<p>pleaze i want the statement of how to make condition on a table in sql database
if this value exits or not if exit i want a speciefic condition to be executed for example show this column (which i want to know if it exist or not) in grid view
like this</p>

<pre><code>da = new SqlDataAdapter("SELECT tagType,[exit-Time],enterTime,name,[tag-id-st],[build-id],punish,[room-no]FROM Students,GateLogging WHERE GateLogging.tagType='student' AND Students.[tag-id-st]=GateLogging.tagID AND DATEDIFF(minute,enterTime,GETDATE())&lt;10 ", MyConn);
</code></pre>

<p>i want to know if punish not null show message box says that</p>
