student table as follows
studid studname minorcode
1 Ram AFF
2 Suresh MFA
3 Vignesh CTF
4 Sunil ROC
course table as follows
Courseid minorcode Amt Paymentmode
1 AFF 5000 Cash
2 MFA 8000 Cash
3 CTF 12000 Cash
4 ROC 16000 Cash
Code as follows in Show Button
string minorcode;
sql = "select s.studname,s.minorcode,c.Amt,c.Paymentmode from studnet s,course c where s.minorcode = c.minorcode
dr = scon.ReadSql(sql);
while (dr.Read())
{
minorcode = dr[0].ToString().Trim();
sql = "Select Amt from course where minorcode = '" + minorcode.ToString().Trim() + "'";
dr1 = scon.ReadSql(sql);
while (dr1.Read())
{
GridView.DataSource = dr;
GridView.DataBind();
GridView.Visible = true;
}
}
from the above coding i want to show the data in gridview as follows
in my above code i am using two datareader(dr) dr and dr1. but i want to show the two datareader values shown in one GridView
for GridView i written the code as above (GridView.DataSource = dr;)
how can i display two datareader values in one Gridview.
i want the output as follows in Gridview;
studname minorcode Amt Paymentmode
Ram AFF 5000 Cash
Suresh MFA 8000 Cash
Vignesh CTF 12000 Cash
Sunil ROC 16000 Cash
please help me.
whether my code is correct.i tried but in gridview above output is not displaying.
Regards,
Narasiman P.