1) SQL : SET @RESULT =(SELECT CONVERT(NVARCHAR, LeadId) + ',' + Name
FROM Lead WHERE (Email = @email))
2) C# :
var outParam = new SqlParameter("@Result", SqlDbType.NVarChar);
outParam.Direction = ParameterDirection.Output;
outParam.Size = 100;
// cmd.Parameters["@Result"].Direction = ParameterDirection.Output;
cmd.Parameters.Add(outParam);
cmd.ExecuteNonQuery();
Result = cmd.Parameters["@Result"].Value.ToString();
FROM Lead WHERE (Email = @email))
2) C# :
var outParam = new SqlParameter("@Result", SqlDbType.NVarChar);
outParam.Direction = ParameterDirection.Output;
outParam.Size = 100;
// cmd.Parameters["@Result"].Direction = ParameterDirection.Output;
cmd.Parameters.Add(outParam);
cmd.ExecuteNonQuery();
Result = cmd.Parameters["@Result"].Value.ToString();
No comments:
Post a Comment