10 TIPs - To Become a Good Developer/Programmer
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
yash patel
1.8k
271
11.3k
object refrence is required for the non static field
Oct 2 2020 5:30 AM
public ActionResult SignUp( UserBO objUserBO )
{
if (ModelState.IsValid)
{
UserBL objUserBL = new UserBL();
if(objUserBO.UserId >= 1)
{
nsrouteEntities.Entry(
objUserBL).State = EntityState.Modified;
}
else
{
CustomBO objCustomBO = objUserBL.AddUser(objUserBO);
return View("Login");
}
}
return View(objUserBO);
}
for the bold part the below error is coming
object reference is required for the non static field,method or property
the form is opening properly but when we submit the form it is
adding
a new record instead of
upadating
the existing record
Reply
Answers (
3
)
System.InvalidOperationException
Two winforms app and data transfer should happen using TCP Channel