selvi subramanian

selvi subramanian

  • NA
  • 799
  • 559.1k

i need to calculate the present days like this

Aug 6 2014 7:08 AM
i have calculated for the first 10 days that is (1-08-2014 to 10-08-2014)

use this method 

  DataSet sds = new DataSet();
        string vew = "select * from salary where Id='" + TextBox1.Text + "' and nextdate='" + TextBox2.Text + "' ";
        sds = mvl.GETDS(vew);
        GridView1.DataSource = sds;
        GridView1.DataBind();
        int count = 0;
        foreach (GridViewRow row in this.GridView1.Rows)
        {
            if (row.Cells[15].Text == "Present")
            {
                count++;
            }
        }
        this.Label3.Text = count.ToString();
        Label3.ForeColor = System.Drawing.Color.LightPink;

in this  i got the result 10 days as output

now my need is (12-08-2014 to 20-08-2014)  i need to calculate the days 


if i use like this means 

  DataSet sds = new DataSet();
        string vew = "select * from salary where Id='" + TextBox1.Text + "' and nextdate='" + TextBox2.Text + "' and Status='" + TextBox3.Text + "'";
        sds = mvl.GETDS(vew);
        GridView1.DataSource = sds;
        GridView1.DataBind();
        int count = 0;
        foreach (GridViewRow row in this.GridView1.Rows)
        {
            if (row.Cells[15].Text == "Present")
            {
                count++;
            }
        }
        this.Label3.Text = count.ToString();
        Label3.ForeColor = System.Drawing.Color.LightPink;



it show the 1ly one day but i need 8 days as output

Answers (2)