Unable to add Namespace using Entity Framework in ASP.Net

Last Reply 11 months ago By kalpesh

Posted 11 months ago

I'm follow your code(code link) from here. but I don't understand where I use AddToCustomers Method and I'm unable to Add NameSpace "TestModelNs".
Here is my aspx file(files link)

Posted 11 months ago
Hi @System,
Please try the following

[Solved] Insert GridView data to Database using Entity Framework in ASP.Net

It might help you.

Cheers Andrea.

Posted 11 months ago

I forgot to mention that i use visual studio 2013, C#.Net framework 4.6, Entity Framework 5 and Sql Server 2012

Posted 11 months ago Modified on 11 months ago

As in example it use to save the Customer details based on customer table entity object.

so you need to use your entity name which you are using by table name.

as in example AddToCustomer is used when we click on add button which saves the textboxes values to customersentities object.

so you need to call the save method where you are trying to save the entity details.

Also if have added Entity Data Model with name TestModelNs then only you can imprt the namespace else you need to use same namespace which you assigned when you created Entity Data Model.

also share your code we are not able to access the links.