SELECT S.Marks,S.QPName,B.Class,B.BthNo,B.Batchdate,B.Attender
FROM STUDDET S,Batch B where S.BthId = B.BthId and S.StudId = '55334'
when i execute the above query output as follows;
Marks QpName Class Bthno Batchdate Attender
56 REO_2011 REO B120RE 2011-09-26 NIRANJAN
64 REO_2011 REO B120RE 2011-09-26 NIRANJAN
in run mode as follows;
Student id txt_studid(textbox) Show (Button)
when i enter the student id and click the show button, the record show be displayed into the gridview
Show Button code as follows;
private string SQl;
private SqlDataReader Dr;
private SqlDataCon SCon = new SqlDataCon();
SQl = "SELECT S.Marks, S.QPName,B.Class,B.BthNo,B.Batchdate,B.Attender FROM STUDDET S,Batch B";
SQl = SQl + "where S.BthId = B.BthId and s.StudId = '" + txt_Studid.Text.ToString() + "'";
try
{
Dr = SCon.ReadSql(SQl);
this.GridView1.DataSource = Dr;
this.GridView1.DataBind();
Dr.Close();
}
catch (Exception e1)
{
Label4.Text = e1.Message.ToString();
return;
}
when i enter the student id in the textbox and click the Show button error shows as follows;
object reference not set to an instance of object.
please help me.
what is the problem in my Show Button code.
Rgds,
Narasiman P.