help me with the error?
Line 32: a.questid = dr["questorder "].ToString();
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullRefe renceException: Object reference not set to an instance of an object.
-----------
using System;
using System.Data;
using System.Configur ation;
using System.Collecti ons;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
namespace TESTPROJ2
{
public partial class QUEST : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
questdetails.Da taBind();
}
protected void Button1_Click(o bject sender, EventArgs e)
{
System.Data.Dat aRowView dr = (System.Data.Da taRowView)quest details.DataIte m;
//dr = ctype(questdeta ils.DataItem, System.Data.Dat aRowView);
ANSWER a = new ANSWER();
//a.questid = dr["questorder "].ToString();
a.correctans = dr["correctans "].ToString();
a.userans = ansdroplist.Sel ectedValue.ToSt ring();
ArrayList a1 = new ArrayList();
a1 = (ArrayList)(Ses sion["answerlist "]);
a1.Add(a);
Session.Add("an swerlist", a1);
if (questdetails.P ageIndex == questdetails.Pa geCount - 1)
{
Response.Redire ct("RESULTS.asp x");
}
else
{
questdetails.Pa geIndex += 1;
}
if (questdetails.P ageIndex == questdetails.Pa geCount - 1)
{
nextb.Text = "finished";
}
}
}
}
Line 32: a.questid = dr["questorder "].ToString();
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullRefe renceException: Object reference not set to an instance of an object.
-----------
using System;
using System.Data;
using System.Configur ation;
using System.Collecti ons;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
namespace TESTPROJ2
{
public partial class QUEST : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
questdetails.Da taBind();
}
protected void Button1_Click(o bject sender, EventArgs e)
{
System.Data.Dat aRowView dr = (System.Data.Da taRowView)quest details.DataIte m;
//dr = ctype(questdeta ils.DataItem, System.Data.Dat aRowView);
ANSWER a = new ANSWER();
//a.questid = dr["questorder "].ToString();
a.correctans = dr["correctans "].ToString();
a.userans = ansdroplist.Sel ectedValue.ToSt ring();
ArrayList a1 = new ArrayList();
a1 = (ArrayList)(Ses sion["answerlist "]);
a1.Add(a);
Session.Add("an swerlist", a1);
if (questdetails.P ageIndex == questdetails.Pa geCount - 1)
{
Response.Redire ct("RESULTS.asp x");
}
else
{
questdetails.Pa geIndex += 1;
}
if (questdetails.P ageIndex == questdetails.Pa geCount - 1)
{
nextb.Text = "finished";
}
}
}
}