title: How to load data to gridview programmatically?
body: <p>This is my  table</p>
  
  <pre><code>A/C Type  A/c No  Mode    Amount  Balance
  ----------------------------------------                 C -&gt; Credit
    A        101    C       500     1000                   D -&gt; Debit
    B        102    D       1000    200
  </code></pre>
  
  <p>I want to show it in a gridview as follows....</p>
  
  <pre><code>A/C Type  A/c No  Credit   Debit     Balance
  ----------------------------------------
    A        101     500      -         1000
    B        102      -       1000      200
  </code></pre>
  
  <p>This is my code and am using C# ASP.NET and  SQL SERVER...</p>
  
  <pre><code>connstr = c.Get_ConnString(StrSubbrcode[I], ConfigurationManager.ConnectionStrings["dbcon"].ToString()); //Connection string
                  if (connstr != "")
                  {
                      c.dr = c.ProcExeReader("SELECT....", connstr);
                      if (c.dr.Read())
                      {
                          K = K + 1;
  
                          c.Connect(connstr);
  
                          SqlDataAdapter sda = new SqlDataAdapter("SELECT..", c.con);
                          sda.Fill(ds);
                          c.con.Close();
                      }
                  }
  
  if (K &gt; 0)
              {
  
  
                  gv_deposit.DataSource = ds;
                  gv_deposit.DataBind();
              }
  </code></pre>
  
  <p>Regards,</p>