user384080
user384080

Reputation: 4682

WPF and reportviewer

I have WPF accesses reporting service using report viewer object and received this error:

the underlying connection was closed. a connection that was expected to be kept alive was closed by server..

can anyone please help?

thanks

Upvotes: 0

Views: 595

Answers (1)

Toby Salais
Toby Salais

Reputation: 11

The problem is the datasource for the report. Since it is a local rdlc file that was copied from another solution, it no longer has the benefit of the datasource that was originally assigned to it. You must be setting the datasource manually to a datatable or to the result of a linq to sql query. To correct the problem, create a new datatable object, fill it with the results of your report query, and then assign it as the datasource for your report.

Upvotes: 1

Related Questions