It looks like obj
isn't initialized when you try to use it in the Binddata
method.
You initialize obj
in the CustomerApplication_Load
method (I dont see where it is called but, I guess it is an event-handler for the Load
event). When you call Binddata
in the constructor, the Load
event hasn't raised yet...
Try to call Binddata
in CustomerApplication_Load
. Something like:
private void CustomerApplication_Load(object sender, EventArgs e)
{
obj = new CustomerManagement.CustomerDataManagement(Constant.laundry_db);
Binddata();
}