In Entity layer we add entity in TITLE Class as
public int titleId { get; set; }
public string titleName { get; set; }
public Author authorObj { get; set; }
public Category categoryObj { get; set; }
In Author
public int authorId { get; set; }
public string authorName { get; set; }
In Category
public int categoryId { get; set; }
public string categoryName { get; set; }
public int price { get; set; }
In presentation layer
au.authorId = int.Parse(TextBox1.Text);
au.authorName = TextBox2.Text;
ca.categoryId = int.Parse(TextBox3.Text);
ca.categoryName = TextBox4.Text;
ca.price = int.Parse(TextBox5.Text);
ti.titleId = int.Parse(TextBox6.Text);
ti.titleName = TextBox7.Text;
ti.authorObj.authorId = int.Parse(TextBox1.Text);
ti.categoryObj.categoryId = int.Parse(TextBox3.Text);
// It showing Object reference not set to an instance error while executing,Please help me how to solve this issue.
Object Reference
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Khan Abrar AhmedRank #778 · 3K reputationPosted Jul 4, 2014, 2:18 AM EDT
yo need to intialise the object or check "Textbox1" is null this error occurs when you are trying to access the null propriety.
so error should be on properyt class or element.
Resolution: put the debugger and check which property is null and then initialise that element or property.