title: How do I Convert Textbox to decimal
body: <p>I want to convert a code in datagrid textbox to decimal but don't just know how to. I have search the net and this forum but not exactly whai I want. Any help would be appreciated Below is the code:</p>
  <pre class="lang-cs prettyprint-override"><code>public void LoadStock() {
    int i = 0;
    dataGridView2.Rows.Clear();
    cn.Open();
    cm = new SqlCommand(&quot;select * from vwStockIn where RefNo like '&quot; + txtRefNo.Text + &quot;' and Status like 'Pending' &quot;, cn);
    dr = cm.ExecuteReader();
    while (dr.Read()) {
      i++;
      dataGridView2.Rows.Add(i, dr[0].ToString(), dr[1].ToString(), dr[2].ToString(), dr[3].ToString(), dr[4].ToString(), dr[5].ToString(), dr[6].ToString(), dr[7].ToString(), dr[&quot;CompanyName&quot;].ToString(), dr[&quot;AccBalance&quot;].ToString());
    }
    dr.Close();
    cn.Close();
  }
  </code></pre>