The EntitySet name could not be found. [Resolved]

Posted by Rickeybglr under LINQ on 9/28/2014 | Points: 10 | Views : 3656 | Status : [Member] | Replies : 2
I am getting the exception while saving context object.
Here is my code

public class DataLayer
{
AppChatEntities1 objEntity = new AppChatEntities1();

public int addDataToRegistration( ApplObjects.UserRegistration obj)
{
try
{

using (var context = new AppChatEntities1())
{
Registration objRegist = new Registration();
objRegist.UserName = obj.StrUserName;
objRegist.EmailId = obj.StrEmailId;
objRegist.FirstName = obj.StrFirstName;
objRegist.LastName = obj.StrLastName;
context.AddObject("Registration", objRegist);
int i = context.SaveChanges();
return i;

}
}

catch (Exception )
{
return 0;
}

}

}




Responses

Posted by: Rickeybglr on: 10/7/2014 [Member] Starter | Points: 25

Up
0
Down

Resolved
I got the solution.
Just Uncheck the Pluralized column option while creating Data model.. thts all

Rickeybglr, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 9/29/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
It might help you

http://social.msdn.microsoft.com/Forums/en-US/7a29d4e3-8550-43dd-aa09-2bb859466c0d/ef-error-entityset-name-could-not-be-found?forum=adodotnetentityframework

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Rickeybglr, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response