locked
Problem with data when I deploy my app. RRS feed

  • Question

  • Hi all,

    I hope I have posted this in the right place, apologies if not.

    I have developed a windows forms application with an sql database which is local to my project. All the database contains is two tables - one is a lookup table, the other is a table which is used to populate a .rdlc report. Everything works perfectly when I debug my application, but now I have deployed my application it can't see either of the tables in the database.

    What am I doing wrong? I'm not sure where to start so if you can help me please let me know what info I need to provide!

    Thanks

    Rowan
    Thursday, February 7, 2008 11:03 AM

Answers

All replies

  • In a Winform application you have two options either create Views for the columns you need for each report or use SQL Server Express Advanced services which lets you use Reporting services free. The reason is when you use Report Viewer in local mode in Winform most reasonable operations run but yours is not running so you are doing some thing to break it. That could load related because you have only one table instead of many as required by relational modeling. So here is code sample from Microsoft and the SQL Server Express Advanced use the ToolKit version if you choose to use it because in reporting services I have written reports with default 163 pages before deployment. 

     

    http://www.gotreportviewer.com/

     

    http://msdn2.microsoft.com/en-us/express/bb410792.aspx

     

    Thursday, February 7, 2008 7:16 PM
  • Hi Caddre

    Thanks for your reply. I will have a good read and hopefully it will help. Just a thought though, I'm not sure it is the reporting component that is the problem, I think it is the database itself. The reason being, I also have a datagridview within my application which is supposed to display the data from the lookup table. Again, this works when I debug my application, however does not work after I deploy.

    Thanks

    Rowan
    Friday, February 8, 2008 8:49 AM
  • OK, I have a bit more information. My application works correctly when I deploy using ClickOnce, but does not work correctly when I use a setup project. So, as I suspected, it is not the reporting component which is the problem it is my method of deployment.

    Do I have to copy the database to the setup project? I thought this would be added automatically, the same as the forms etc.

    Any thoughts?

    Thanks

    Rowan
    Friday, February 8, 2008 12:56 PM
  • Hi All

    Please see my previous thread from a different forum. I've reposted here because I believe it is now more relevant to deployment than it is to data.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2806862&SiteID=1

    Please help!

    Thanks

    Rowan
    Friday, February 8, 2008 1:05 PM
  • No it does not you either use detach and attach or backup and restore in code with your setup project.

     

    Friday, February 8, 2008 2:06 PM
  • Ok now I'm lost! This is completely new ground to me (but that's understandable since this is my first major project). Could you kindly explain in a little more detail?
    Friday, February 8, 2008 2:39 PM
  • If you created the database in VS you copy the database and attach it to SQL Server, so you are detaching it from VS and attaching it to SQL Server.  So you add all your connection information to this database in your app.config file so after deployment you can still connect to your database.  Here are some code samples using both ADO.NET and T-SQL to create a database.  You have the option of moving the database first or move it with your deploment setup.

     

    http://www.c-sharpcorner.com/UploadFile/mahesh/CreatingDBProgrammaticallyMCB11282005064852AM/CreatingDBProgrammaticallyMCB.aspx


    http://support.microsoft.com/kb/305079


    http://msdn2.microsoft.com/en-us/library/aa258257.aspx

     

    Friday, February 8, 2008 3:28 PM
  • Caddre

     

    Thank you very much for the info, it is much appreciated. I'm sure I'll find the answer here.

     

    Thanks

     

    Rowan

    Friday, February 8, 2008 3:40 PM
  • Caddre

     

    Again, thank you very much.

     

    Rowan

    Friday, February 8, 2008 3:57 PM