how do I get the value instead of count?

Nirmala

Member
Joined
Jan 30, 2022
Messages
10
Programming Experience
Beginner
C#:
var or = await _context
.OrganisationID
.FromSqlRaw("SELECT pj.proj_org_id as orgId FROM[mapping].[DataResourceTenancy] as dt JOIN web.Project as pj on dt.drp_projCode = proj_code where drp_amrd_serialNumber like {0} ", deviceName)
.ToListAsync();


When I execute, it is giving me the count not the value. Please help me
 
Last edited by a moderator:
But FcGetOrgIdByDeviceName is not a string. You were asking about how to convert a string to an int. It's a class that you declared as part of your EF model. You should know how to pull the value you need out of that class since you defined that class.
 
But FcGetOrgIdByDeviceName is not a string. You were asking about how to convert a string to an int. It's a class that you declared as part of your EF model. You should know how to pull the value you need out of that class since you defined that class.
namespace JuiceNextGen.DataLibrary.dbModel
{
public class FcGetOrgIdByDeviceName
{
public int OrgId { get; set; }
}
}
This is my class
 
Thanks for your help :). I'm a beginner working all by myself, seeking help from experienced people like you
 
Last edited:
Back
Top Bottom