protected void btnPDF_Click(object sender, EventArgs e)
{
DataTable _dtpdf = new DataTable();
_dtpdf = (DataTable)(ViewState["TempData"]);
DataTable _dtimport = new DataTable();
try
{
string memberno = "1002,1003";
DataRow[] rowsfound = _dtpdf.Select("MEMBERNO('" + memberno + "')");
_dtpdf.Clear();
foreach (DataRow item in rowsfound)
{
_dtimport.ImportRow(item);
}
int j = _dtpdf.Rows.Count;
Rpt_Company.DataSource = _dtpdf;
Rpt_Company.DataBind();
}
catch (Exception ex)
{
throw ex;
}
1.in the above coding i created a datatable
DataTable _dtpdf = new DataTable();
2. _dtpdf = (DataTable)(ViewState["TempData"]);
and assigned to the viewstate
3. string memberno = "1002,1003";
manually i am giving this 2 numbers in the source page and i am selecting only these 2 items in the repeater control
4. DataRow[] rowsfound = _dtpdf.Select("MEMBERNO('" + memberno + "')");
selected item should be stored in rowsfound ......but it is not happening.....PLease help me
i am getting object refernce not set to an instance of a object
PLease tell any the logic or correct my error