How to find column existence in data table in C#?
<p>I have problem. I have 2 queries in a stored procedure. Both run on certain condition if condition is true query one executes and returns 7 columns from 3 tables. If condition fail 2nd query returns 4 columns.</p>

<p>On front end I use a datatable to store query result. I assign values to textbox from datatable.</p>

<p>like</p>

<p>dt is data table name</p>

<pre><code>Txt_name.Text=dt.Rows[0][6].ToString();
</code></pre>

<p>problem is that when 2nd query executes an error occurs. No columns exists at 6.</p>

<p>How I find dt has column at at index 6 or not?</p>
