A c# solution with 3 projects:
1. linq-to-sql Business Layer.
2. Web Service layer.
3. Normal proxy, web consumer fromnt end with all my UI.
Problem:
I cannot get an nvarchar value from my stored procedure that I can use in the code.
The Procedure:
ALTER PROCEDURE [dbo].[spGetLocked]
@appid varchar(10),
@examcode varchar(10)
AS
BEGIN
SET NOCOUNT ON;
SELECT record_lock
FROM user_result
WHERE appid = @appid and exam_id = @examcode
RETURN
END
The code built in the designer:
[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.spGetLocked")]
public ISingleResult<spgetlockedresult> spGetLocked([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="VarChar(10)")] string appid, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType="VarChar(10)")] string examcode)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), appid, examcode);
return ((ISingleResult<spgetlockedresult>)(result.ReturnValue));
}
My attempt at calling the procedure:
ExamBusiness.ExamsDataContext db = new ExamBusiness.ExamsDataContext();
string recLock = db.spGetLocked(appid, examid).
return recLock;
I am trying to get the value of field
record_lock
(T or F)
nvarchar(1)
for a business decision in my
check_login
code.
Please help, I have been stuck for 10 straight hours.
Thank you,
Suzanne