Hi this is my code and am getting error like Nullreferenceexception was unhandled by user code
can u pls help me..by finding out my error
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Specialized;
using A = Apollo;
public partial class HrHealthAgency : System.Web.UI.Page
{
protected A.HRHealthAgency OHealthagency;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void btnadd_Click(object sender, EventArgs e)
{
OHealthagency.AddHRHealthAgency(txttitle.Text, txtforename.Text, txtsurname.Text, txtjobtitle.Text, txtcompany.Text, txtaddress.Text, txtaddressline1.Text,
txtaddressline2.Text, txttowncity.Text, Convert.ToInt32(txtpostcode.Text.ToString()), Convert.ToInt32(txtphonenumber.Text.ToString()),
txtcontactemail.Text, txtconfirmemail.Text, txtchooseusername.Text, txtchoosepassword.Text, txtconfirmpassword.Text);
Clear();
}
protected void Clear()
{
txttitle.Text ="";
txtforename.Text="";
txtsurname.Text="";
txtjobtitle.Text="";
txtcompany.Text="";
txtaddress.Text="";
txtaddressline1.Text="";
txtaddressline2.Text="";
txttowncity.Text="";
txtpostcode.Text="";
txtphonenumber.Text="";
txtcontactemail.Text="";
txtconfirmemail.Text="";
txtchooseusername.Text="";
txtchoosepassword.Text="";
txtconfirmpassword.Text="";
}
}