title: getting two column values from same table depending on the condition
body: <p>I have two tables: </p>
  
  <pre>
  table product1 with columns:
      product_id 
      prodcut_name
      category_id
  </pre>
  
  <pre>
  another table  categories 
      category_id
      category_name
      category_description
  </pre>
  
  <p>I am populating product details using <code>DataGridView</code> and it's working fine.</p>
  
  <p>I am trying to get the two column values from same table depending on the same condition that I have got  the code below:</p>
  
  <pre><code>string desc = Convert.ToString(selectedRow.Cells["productdescr"].Value);
  string productname = Convert.ToString(selectedRow.Cells["productnam"].Value);
  string productprices = Convert.ToString(selectedRow.Cells["productprice"].Value);
  int  productids = Convert.ToInt32(selectedRow.Cells["productid"].Value);
  </code></pre>
  
  <p><strong>condition 1:</strong></p>
  
  <pre><code>int  categoryids = (from cats in tsg.product1
                      where cats.product_Name.Equals(productname)
                      select cats.category_Id).SingleOrDefault();
  </code></pre>
  
  <p><strong>condition 2:</strong></p>
  
  <pre><code>var catogynames = (from categorytypes in tsg.categories
                     where categorytypes.category_Id.Equals(categoryids)
                     select  categorytypes.category_Name
                    ).SingleOrDefault();
  </code></pre>
  
  <p><strong>condition 3:</strong></p>
  
  <pre><code>var categoprydecription = (from categorytable in tsg.categories
                             where categorytable.category_Id.Equals(categoryids)
                             select categorytable.category_Description
                            ).SingleOrDefault();
  </code></pre>
  
  <p>I want to get the <code>categorytypes.category_description</code> also along with this  <code>categorytypes.category_Name</code> from the <strong>condition 2</strong>, is it possible to combine the two conditions? (condition 2 and condition 3)</p>