Divya Jagadeesh

Divya Jagadeesh

  • NA
  • 13
  • 4.2k

Problem with the Static Datatable? any help asap pls?

May 9 2013 2:05 AM
Hi,

    In my application i have few datatables. but one of the datatable is getting cleared when the page postbacks. Sometimes it works fine. sometimes i am facing this issue. Can anybody help me out pls.


Code Snippet:

  public static DataTable dtAnswer = new DataTable();
    public static DataTable dtPartitioned = new DataTable();
    public static DataTable dtAnsCount;


getting an  error at this point,

   if (dtAnsCount.Columns.Count == 0)
        {
}

Note:[The error is occuring at certain instance - saying object reference not set to an instance, which says that datatable doesn't exists]

Thanks in Advance!

Regards,
Divya

Answers (4)