title: How to store variable and select where in DataGridView C#
body: <p>I have this set of code which will return the sum of <code>SelisihLoadSchAct</code> column where column <code>SchLoadSubVessel</code> equal to variable <code>SubVesselName</code> and <code>SchLoadVessel</code> equal to SubVoyageNo to variable with data type of double called <code>SisaSelisihSchLoad</code></p>
  
  <pre><code>double SisaSelisihSchLoad = dgv_bulkclink.Rows.Cast&lt;DataGridViewRow&gt;()
  .Where(r =&gt; Convert.ToString(r.Cells["SchLoadSubVessel"].Value) == SubVesselName &amp;&amp; Convert.ToString(r.Cells["SchLoadVessel"].Value) == SubVoyageNo)
  .Sum(t =&gt; Convert.ToInt32(t.Cells["SelisihLoadSchAct"].Value));
  </code></pre>
  
  <p>and now the problem is, how do i just select? not sum? i tried changing sum to select but it return error instead or am i doing something wrong with the select statement?</p>
  
  <p>edit: updated problem</p>
  
  <p>how do i use <code>%</code> just like in query? as example <code>SELECT Column FROM Table WHERE Column1 LIKE 'SubVesselName%'</code></p>