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
Charles Zvarimwa
NA
65
3.9k
Cannot Implicitly convert type decimal to webservice.tblmast
Oct 15 2019 3:09 AM
I am new to web services in ASP.net and I was creating a simple webservice that pulls data from SQL server to Infopath form. My sample class before importing into infopath is shown below and is giving an error "Connot implicitly convert type decimal to webservice.tblMaster"
public class WebServiceController : ApiController
{
public IEnumerable<tblMaster> Get()
{
using (EmployeeEntities dbcontext = new EmployeeEntities())
{
return dbcontext.tblMaster.ToList();
}
}
public tblMaster Get(string id)
{
using (EmployeeEntities dbcontext = new EmployeeEntities())
{
var LeaveDays = dbcontext.tblMaster.Where(e => e.EmpCode == id).Select(o => o.LeaveDue).SingleOrDefault();
return LeaveDays;
}
}
}
Reply
Answers (
1
)
Unable to read the data in API
cannot implicitly convert type bool to string c#