none
LocalReport Timeout Error RRS feed

  • Question

  • I have a ReportViewer Control in vs2005 that has recently displaying a timeout error when it runs at the 30 second mark. The local report uses a Dataset object to query our SQL server. Typically you can set a timeout property to a command object. However to use a localReport I must use a dataset with it as far as I know. Is there a way to set a timeout on a dataset object or is there some other way to set a timeout on this?

    My query takes about 50 seconds to execute. I tried putting a timeout setting in the connection string but that doesn't make any difference.

    Thanks,

    Tim
    Monday, March 23, 2009 4:52 PM

Answers

  • I have finally resolved the solution to this after 4 Days of pulling my hair out. In case anyone has a similar problem, here is my solution. You may find that only part 2 of this is necessary depending on your situation.

    Problem #1
    My project was a "Web Site" Project. In order to perform certain functionality I had to convert it to a "Web Application" project. Essentially in my case the reason for this is the xxxDataset.xsd file on a Web Site project gets put into the .net App_Code folder. This has limited public functionality and the partial class needed (described later) was not able to find the code in the App_Code folder. There's actually alot more to this, but this is the simplest way to explain it. Here is a good link to describe how to convert the project type (backup your project first):
    http://msdn.microsoft.com/en-us/library/aa983476(VS.80).aspx


    Problem #2
    The timeout property is controlled by the TableAdapter, but it's not a public property item that can be changed directly. However, using a partial class can gain access to it. There was actually alot of links out there that explained this. I diligently followed their instructions but could never get it to work. Until I read about differences beetween a "Web Site" and a "Web Application" project in regards to how the App_Code folder is utilized. So, If I found step one first this would of been a simple fix. Here is a good link to create and utilize a partial class to expose the command timeout property of a Table Adapter:
    http://www.velocityreviews.com/forums/t123018-p2-how-to-set-commandtimeout-for-objectdatasource-aspnet-20.html


    So, if you have a Reporting Services ReportViewer control in use for localReports and you are having timeout issues. Either the 2nd step by itself should resolve your problem or both steps if you have a "Web Site" project in VS 2005.  I did read about methods of using classes inside the App_Code folder, I never got any recommendations to work. I'm sure it can be done, but converting the project made it work for me and after 4 days I aint about to try another alternative. 


    Tim

    • Marked as answer by Tim Hirtle Tuesday, March 31, 2009 3:10 PM
    Friday, March 27, 2009 7:43 PM

All replies

  • I have finally resolved the solution to this after 4 Days of pulling my hair out. In case anyone has a similar problem, here is my solution. You may find that only part 2 of this is necessary depending on your situation.

    Problem #1
    My project was a "Web Site" Project. In order to perform certain functionality I had to convert it to a "Web Application" project. Essentially in my case the reason for this is the xxxDataset.xsd file on a Web Site project gets put into the .net App_Code folder. This has limited public functionality and the partial class needed (described later) was not able to find the code in the App_Code folder. There's actually alot more to this, but this is the simplest way to explain it. Here is a good link to describe how to convert the project type (backup your project first):
    http://msdn.microsoft.com/en-us/library/aa983476(VS.80).aspx


    Problem #2
    The timeout property is controlled by the TableAdapter, but it's not a public property item that can be changed directly. However, using a partial class can gain access to it. There was actually alot of links out there that explained this. I diligently followed their instructions but could never get it to work. Until I read about differences beetween a "Web Site" and a "Web Application" project in regards to how the App_Code folder is utilized. So, If I found step one first this would of been a simple fix. Here is a good link to create and utilize a partial class to expose the command timeout property of a Table Adapter:
    http://www.velocityreviews.com/forums/t123018-p2-how-to-set-commandtimeout-for-objectdatasource-aspnet-20.html


    So, if you have a Reporting Services ReportViewer control in use for localReports and you are having timeout issues. Either the 2nd step by itself should resolve your problem or both steps if you have a "Web Site" project in VS 2005.  I did read about methods of using classes inside the App_Code folder, I never got any recommendations to work. I'm sure it can be done, but converting the project made it work for me and after 4 days I aint about to try another alternative. 


    Tim

    • Marked as answer by Tim Hirtle Tuesday, March 31, 2009 3:10 PM
    Friday, March 27, 2009 7:43 PM

  • So, if you have a Reporting Services ReportViewer control in use for localReports and you are having timeout issues. Either the 2nd step by itself should resolve your problem or both steps if you have a "Web Site" project in VS 2005.  I did read about methods of using classes inside the App_Code folder, I never got any recommendations to work. I'm sure it can be done, but converting the project made it work for me and after 4 days I aint about to try another alternative. 


    One additional note on this. You MUST make sure the namespace on your Partial Class and your class name matches the original TableAdapter's namespace and class name exactly. If they do not match then you will get a build error. So, you should review the automatically generated code of your xxxDataset.Designer.cs file to find the namespace and class name created. In my case this was near the end of the code file. Once you obtain these names add the exact same names in your partial class. If the build works then you are likely in good shape. If you are sure your namespace and class names do match but your are receiving an error on the CommandCollection[i] property of your partial class then it may be a scope problem. This was the case for me and problem#1 was the solution to fix this problem. Taking my xxxDataset.xx files out of the App_Code folder while converting it to a "Web Application" folder exposed the TableAdapter's timeout property.
    Tuesday, March 31, 2009 3:30 PM