This question is locked. New answers and comments are not allowed.
Now I want to calculate the average concentration of pm2.5 these days in each city through stored procedure .The first input parameter of the stored procedure is cityname string like Beijing,NewYork,and the other input parameters are beginTime and endTime.And the output class is called AvgPM25.
public class AvgPM25{public String CityName{get;set;}public decimal AvgValue{get;set;}}I pass parameters like
Beijing,NewYork,20140801,20140802Beijing,NewYork,20130801,201408025 Answers, 1 is accepted
0
Hi Liu,
OpenAccess does not cache the results of stored procedure calls. I guess, that the changed parameters will not lead to different results because the data in the database is not changed (yet).
Can you post how you are calling the stored procedure? Also, you do not need to make the result type persistent.
Regards,
Thomas
Telerik
OpenAccess does not cache the results of stored procedure calls. I guess, that the changed parameters will not lead to different results because the data in the database is not changed (yet).
Can you post how you are calling the stored procedure? Also, you do not need to make the result type persistent.
Regards,
Thomas
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
0
Liu
Top achievements
Rank 1
answered on 05 Aug 2014, 04:14 PM
[quote]Thomas said:Hi Liu,
OpenAccess does not cache the results of stored procedure calls. I guess, that the changed parameters will not lead to different results because the data in the database is not changed (yet).
Can you post how you are calling the stored procedure? Also, you do not need to make the result type persistent.
Regards,
Thomas
Telerik
[/quote]
Yes,my stored procedure do not change the database.My stored procedure just calculate and output the average concentration of pm2.5.
"you do not need to make the result type persistent" what does this mean?If the result type is persistent,and then What is the role of this persistent? .I call the stored procedure like this:
using (var dbContext = new EntitiesModel())
{
return dbContext.CalculateAvg(CityName,startDateTime, endDateTime);
}
OpenAccess does not cache the results of stored procedure calls. I guess, that the changed parameters will not lead to different results because the data in the database is not changed (yet).
Can you post how you are calling the stored procedure? Also, you do not need to make the result type persistent.
Regards,
Thomas
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Yes,my stored procedure do not change the database.My stored procedure just calculate and output the average concentration of pm2.5.
"you do not need to make the result type persistent" what does this mean?If the result type is persistent,and then What is the role of this persistent? .I call the stored procedure like this:
using (var dbContext = new EntitiesModel())
{
return dbContext.CalculateAvg(CityName,startDateTime, endDateTime);
}
0
Hello Liu/Xi,
could you please be so kind and paste the CalculateAvg method here too?
Regards,
Thomas
Telerik
could you please be so kind and paste the CalculateAvg method here too?
Regards,
Thomas
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
0
Liu
Top achievements
Rank 1
answered on 06 Aug 2014, 06:36 AM
[quote]Thomas said:Hello Liu/Xi,
could you please be so kind and paste the CalculateAvg method here too?
Regards,
Thomas
Telerik
[/quote]
CalculateAvg is the stored procedure.I just do follow the teaching material Using the Context API Approach.
could you please be so kind and paste the CalculateAvg method here too?
Regards,
Thomas
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
CalculateAvg is the stored procedure.I just do follow the teaching material Using the Context API Approach.
0
Hello Liu,
I don't see that we are caching results from stored procedure calls. Just in case you use the second level cache (database level cache): Could you turn off caching to see if this makes a differerence?
Regards,
Thomas
Telerik
I don't see that we are caching results from stored procedure calls. Just in case you use the second level cache (database level cache): Could you turn off caching to see if this makes a differerence?
Regards,
Thomas
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.