title: how to show blank instead of 0 in datagridview c#.net
body: <p>I am working on a window application Visual Studio 2010 and SQL Server 2008. My code is working fine. I need only one thing that if any value is <code>0.000</code> in database, it should be shown blank in <code>DataGridView</code>. Please, give me solution. Thanks in advance. Code is given below:</p>
  
  <pre><code>sda = new SqlDataAdapter("select Item, Cast (Val1 AS DECIMAL (10,3)), Cast (Val2 AS DECIMAL (10,2)), Cast (Val3 AS DECIMAL (10,2)), Cast (Val4 AS DECIMAL (10,3)), sno from Opstk where Vno ='" + txtVno.Text + "'",  con);
          DataTable dt = new DataTable();
          sdaq.Fill(dt);
  
          dataGridView1.Rows.Clear();
          foreach (DataRow item in dt.Rows)
          {
              int n = dataGridView1.Rows.Add();
              dataGridView1.Rows[n].Cells[0].Value = item["Item"].ToString();
              dataGridView1.Rows[n].Cells[1].Value = item[1].ToString();
              dataGridView1.Rows[n].Cells[2].Value = item[2].ToString();
              dataGridView1.Rows[n].Cells[3].Value = item[3].ToString();
              dataGridView1.Rows[n].Cells[4].Value = item[4].ToString();
              dataGridView1.Rows[n].Cells[5].Value = item[5].ToString();
  
          }
  </code></pre>