Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Friday, March 30, 2012

Problem with SQLCacheDependency

I am using a grid to display the data on my webpage, and I have 3 projects in my solution (UI, BLL, DAL). When I load the webpage I am creating the instance of a class written n my BLL project to populate the data, and in BLL I'm creating the object for the class in DAL and returning the datatable.

Now when I refresh the page using F5, the SQLDependency is working fine. But, when I use the Paging or Sorting option's on my grid I see in SQL Profiler that the query is posted back to the SQLServer to get the data.

If this is the senario then how can I make use of the cache object in .NET 2.0.

Please advice,
Ravi

I've posted a blog article that tries to explain some of the misteries behind Query Notifications here: http://blogs.msdn.com/remusrusanu/archive/2006/06/17/635608.aspx, maybe it can help you troubleshoot the issue.

I'm relly no expert in the SqlDependnecy functionality, but the explanation you give seems way too short to understand what the problem is.

HTH,
~ Remus

sql

Monday, March 12, 2012

Problem with Reusing ReportViewer Control

I am resusing the Report Viewer Control depending on a selection the user
makes.
I load the report definition as follows:
rvFBReport.LocalReport.LoadReportDefinition(sr)
where sr is a streamreader loading the rdl file.
Then I pass in the datasource via:
rvFBReport.LocalReport.DataSources.Add(rds)
where rds is a reportdatasource.
It works great until I try loading a different report using the same
reportviewer.
I have also tried using rvFleetInvoices.LocalReport.DataSources.Clear()
but to no effect. What happens is the report comes up but contains no data
even though there is. It is almost as if the report is not refreshing the
data when switching between different RDL's
Any help/thoughts would be appreciated.Here is another symptom that may narrow it down. If the other reports that I
select has fields with the same name then those fields show up. But any
fields that were not in the first loaded report do not show up. It is almost
as if the datasource is not refreshing the field list.
"Scott Eguires" wrote:
> I am resusing the Report Viewer Control depending on a selection the user
> makes.
> I load the report definition as follows:
> rvFBReport.LocalReport.LoadReportDefinition(sr)
> where sr is a streamreader loading the rdl file.
> Then I pass in the datasource via:
> rvFBReport.LocalReport.DataSources.Add(rds)
> where rds is a reportdatasource.
> It works great until I try loading a different report using the same
> reportviewer.
> I have also tried using rvFleetInvoices.LocalReport.DataSources.Clear()
> but to no effect. What happens is the report comes up but contains no data
> even though there is. It is almost as if the report is not refreshing the
> data when switching between different RDL's
> Any help/thoughts would be appreciated.|||Never Mind I solved it myself. You have to do a reset before making the
change. i.e.,
reportviewer1.reset
"Scott Eguires" wrote:
> I am resusing the Report Viewer Control depending on a selection the user
> makes.
> I load the report definition as follows:
> rvFBReport.LocalReport.LoadReportDefinition(sr)
> where sr is a streamreader loading the rdl file.
> Then I pass in the datasource via:
> rvFBReport.LocalReport.DataSources.Add(rds)
> where rds is a reportdatasource.
> It works great until I try loading a different report using the same
> reportviewer.
> I have also tried using rvFleetInvoices.LocalReport.DataSources.Clear()
> but to no effect. What happens is the report comes up but contains no data
> even though there is. It is almost as if the report is not refreshing the
> data when switching between different RDL's
> Any help/thoughts would be appreciated.