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.