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
Hadeer Mohamed
NA
3
993
How to compare the data in sqlServer using WCF with MVC ?!!
Dec 19 2018 7:22 PM
i can't read from database then compare this string with the parameter of certain function
i'm using ASP.net MVC4
i tried that i create WCF as following :
public int login_service (string username, string password)
{
OnlineFoodOrderingEntities user1 = new OnlineFoodOrderingEntities();
var x = from n in user1.users select n;
List
tst= x.ToList
();
if (tst[0].username == username && tst[0].password == password )
{
return 1;
}
else{
return 0;
}
}
then in MVC application
public ActionResult Login(string username, string password)
{
ServiceReference1.ServiceClient sc = new ServiceReference1.ServiceClient();
int check = sc.login_service(username,password);
if ( check == 1)
{
return RedirectToAction("cuisine", "Home");
}
else
{
return View();
}
}
the database is called OnlineFoodOrdering
and the table is called user
i want when the check variable is equle to "1" it redirect to Home/cuisine.
please any help
thanks in advance
Reply
Answers (
1
)
How to WebAPI will communicate?
Need help on web API