TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
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
Forums
Monthly Leaders
Forum guidelines
Denmark Puso
NA
232
50.3k
how to check in my dabase if the value is existing?
Aug 25 2019 9:16 PM
im using asp.net mvc 5 im new bee here. my problem is i have a tbl_register the content is
Username
password
repeat-password
contact number
then i fill up the form, all i need is to validate if the contact number is existing to another table in tbl_client. this is my code. my code is not working
var agent = _clientService.Find(x => x.ContactPrimary == newUser.ContactNumber);
if
(agent !=
null
)
{
var client =
new
Client
{
ParentClientId = agent.FirstOrDefault().Id,
FirstName =
""
,
LastName =
""
,
MiddleName =
""
,
Suffix =
""
,
ContactPrimary =
""
,
ContactSecondary =
""
,
Age = 0,
Gender =
""
,
CountryId = 0,
StateId = 0,
CityId = 0,
TownId = 0,
EmailAddress =
""
,
Postcode = 0,
Commission = 0,
SubAgentCommissionPercentage = 0,
Address =
""
};
_clientService.Add(client);
}
Reply
Answers (
3
)
Update the value in db
In EF Database First, How to call SP in Command Prompt