<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Get value from field' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Get value from field' posted on the 'C#' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Tue, 18 Jun 2013 14:25:17 -0700</pubDate>
    <lastBuildDate>Tue, 18 Jun 2013 14:25:17 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Get value from field</title>
      <link>http://www.programmersheaven.com/mb/csharp/424125/424125/get-value-from-field/</link>
      <description>Hi i need to get the value of a field:&lt;br /&gt;
&lt;br /&gt;
How could i get the value of the field request (the field type is boolean&lt;br /&gt;
&lt;br /&gt;
Thank's in advance&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;string sql = "SELECT request FROM Table1 where id = 10";
        string connectionString = WebConfigurationManager.ConnectionStrings["Connect
ionString"].ConnectionString;
        SqlConnection con = new SqlConnection(connectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = con;
        con.Open();
        cmd.CommandText = sql;
        SqlDataReader dr;
        dr = cmd.ExecuteReader();&lt;/pre&gt;&lt;br /&gt;
        &lt;br /&gt;
Thank's in advance&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/424125/424125/get-value-from-field/</guid>
      <pubDate>Tue, 28 Jun 2011 11:42:04 -0700</pubDate>
      <category>C#</category>
    </item>
    <item>
      <title>Re: Get value from field</title>
      <link>http://www.programmersheaven.com/mb/csharp/424125/424126/re-get-value-from-field/#424126</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I believe you can do something like below. The syntax might not be correct but you will get an idea.&lt;br /&gt;
&lt;br /&gt;
while (reader.Read())&lt;br /&gt;
{&lt;br /&gt;
    if(reader.GetValue(0) != DBNull.Value)&lt;br /&gt;
    {&lt;br /&gt;
        bool result = reader.GetValue(0)&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Hope this helps&lt;br /&gt;
&amp;lt;a href="http://www.serverintellect.com"&amp;gt;ASP.NET Hosting&amp;lt;/a&amp;gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/424125/424126/re-get-value-from-field/#424126</guid>
      <pubDate>Wed, 29 Jun 2011 00:29:29 -0700</pubDate>
      <category>C#</category>
    </item>
  </channel>
</rss>