Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Design screen as follows


Faculty ID ddlfacid(dropdownlist)
Month Ddlmonth(dropdownlist)
Year ddlyear(dropdownlist)


Show(Button)

And one Gridview is there

Generate Button code as follows
  try
       {
           if (Ddlmonth.SelectedItem.Text.ToString().Trim() == "Select")
           {
               Label4.Text = "Select the month";
           }

           if (ddlyear.SelectedItem.Text.ToString().Trim() == "Select")
           {
               Label4.Text = "Select the year";
           }


           string month = Ddlmonth.SelectedValue.ToString();

           sql = "select bthid,class,bthno from batch where month(examdate) = " + month + " and year(examdate) = " + ddlyear.SelectedValue.ToString() + " order by 1 asc";
           dr = scon.ReadSql(sql);
           while (dr.Read())
           {
           sql = "select avg(case rate when 1 then 100 when 2 then 75 when 3 then 50 when 4 then 25 when 0 then 0 end) from studdet s, facfeedback f  where f.studid =s.studid and f.answerid = s.answerid " + "and f.bfid = '" + ddlfacid.SelectedValue.ToString() + "'
                 and s.bthid = '" + dr[0].ToString().Trim() + "' order by 1 asc";
               dr1 = scon.ReadSql(sql);
               GridView3.DataSource = dr1;
               GridView3.DataBind();
               GridView3.Visible = true;
           }
}
       catch (Exception ex)
       {
           Label4.Text = "Error :" + ex.Message.ToString();
           Label4.Visible = true;
           return;
       }

When i click the generate Button in gridview rate as retrieved from the database.


Output as follows in gridview


Course Batchid Rate

86


in gridview i also want to display the course and batchid of that selected facultyid in the dropdownlist.


for that how can i write the code in the generate button.

in my above generate button code what i have to do in as.net using cSharp.

please help me.

Regards,
Narasiman P.
Posted
Updated 28-Sep-13 7:05am
v2
Comments
Ganesh KP 28-Sep-13 13:52pm    
Hi Narsimhan, I am very sorry that I could not understand your requirment. Can u please tell us clearly what do u want to do exactly?
ZurdoDev 28-Sep-13 16:01pm    
What is your question?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900