When I execute my stored procedure in SQL Server Management Studio, it returns the results in less than 1 second, but when I try to load data via LINQ and this code, it takes up to 5 seconds. Any quick suggestions?
[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.SP_SELECT_MyData")]
public ISingleResult<SP_SELECT_MyDataResult> SP_SELECT_MyData([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="VarChar(50)")] string bname)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), bname);
return ((ISingleResult<SP_SELECT_MyDataResult>)(result.ReturnValue));
}
This line takes all the time
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), bname);