0

I am trying to preview quite a large report in SSRS and every time I try I get the error:

An error occurred during report processing, Cannot create a connection to data source CometTracker. A network related or instance-specific error occurred while establishing a connection to SQL Server. Named pipes error 40

I have checked the connection string is correct, the dataset queries the data fine and sql is running in configuration manager.

I am using Visual Studio Team System and Team Foundation. The only thing I can think of is I have recently changed Laptops and this may have had an effect.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
user2520671
  • 83
  • 3
  • 13
  • Check this [Pinal Dave article](http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/), I think it will point you in the right direction. – sion_corn Jun 25 '13 at 16:31
  • I followed this tutorial, under SQL I cannot check if SQL services is running I get the following - RPC Procedure not started.Then go to services and RPC is running and set to automatic. – user2520671 Jun 26 '13 at 08:44

1 Answers1

1

I get this error sometimes and it relates to the data source being read only in the bin\Debug, bin\DebugLocal or bin\Release directory (depending on your solution configuration variable).

TFS makes the files read only, Visual Studio then copies the files to one of these folders in preparation to run the report. The next time it copies it the copy fails because the file is read only and for some reason the whole thing fails with the Named Pipes error message.

You can just delete the entire bin directory and Visual Studio will rebuild the project and re-copy the files and your data source will magically work again.

Chris Latta
  • 20,316
  • 4
  • 62
  • 70
  • Thanks for the help but this didnt resolve the issue, I must mention aswell that some of the reports I can preview with no issues.This is the only report I am having issues with – user2520671 Jun 26 '13 at 09:10
  • Do the reports you can preview use the same DataSource? Does the report work if you deploy it? – Chris Latta Jun 26 '13 at 11:41
  • Yes they all use the same db and no it doesnt – user2520671 Jun 26 '13 at 11:54
  • I imagine you don't actually use Named Pipes? You might have come across a query that falls victim SSRS' occasionally horrible execution plans. Check [my answer about parameter sniffing](http://stackoverflow.com/questions/16924144/why-does-the-2nd-t-sql-query-run-much-faster-than-the-first-when-called-by-repor/16929881#16929881) to see if that might help. – Chris Latta Jun 26 '13 at 12:03
  • The query im using is just a simple select all I cant imagine why it would run slow because of that – user2520671 Jun 26 '13 at 12:10