Visual Studio Packaging issue RRS feed

  • Question

  • Hello, new here so i'll try to be as detailed as possible with my problem.

    i designed a program using Visual Studio 2008 writing in C# and ADO.Net code. I have a database that i call from inside the program folder at E:\Work\Business Database\Business Database\bin\Debug\Business Database.accdb.

    now i call the database using this line:

    string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;"
                    + "Data Source=" + Application.StartupPath +
                    @"\Business Database.accdb;";

    as long as i run the program in Visual Studio 08, it works fine. but after i package the program and install it on the computer it starts up and call this error

    Unhandled exception has occurred in your application. If you click Continue, the application will igrone this error and attempt to continue. If you click Quit, the apllication will close immediately.

    Could not find file
    "C:\Users\Labuser\AppData\Local\Apps\2.0\0CA5CM4Z.WWE\OYLEVVVD.207\busi..tion_6c5c1be365b149ad_0001.0000_64625137b6b1e4dd\Business Database.accdb".

    and here's some of the exection data:

    ************** Exception Text **************
    System.Data.OleDb.OleDbException: Could not find file 'C:\Users\labuser\AppData\Local\Apps\2.0\0CA5CM4Z.WWE\OYLEVVVD.207\busi..tion_6c5c1be365b149ad_0001.0000_64525137b6b1e4dd\Business Database.accdb'.
       at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
       at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.OleDb.OleDbConnection.Open()
       at Business_Database.PasswordScreen.Form1_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Can anyone make heads or tails out of this?
    Monday, December 8, 2008 3:37 PM


All replies

  • Hi,

    How you are deploying your project???

    Using Clickonce ??

    I don't think it is posiible to deploy a database or any extra files using clickonce

    Instead you can create an msi setup to deploy your project

    Here is some links to create msi setup




    Monday, December 8, 2008 4:12 PM
  • i'm using the basic packaging tool in Visual Studio 08 under

    Build > Publish Business Database
    Monday, December 8, 2008 4:18 PM
  • Yes, that is clickonce method

    Using clickonce you are not able to deploy any extra files also you are not able to specify the installed location

    Monday, December 8, 2008 4:25 PM
  • I'm sorry, but this has absolutely nothing to do with the VSTO technology. Since I don't see a specific forum for deployment questions on the site, I'm moving this message thread to "Where is the Forum for" for re-direction.
    Cindy Meister, VSTO/Word MVP
    Monday, December 8, 2008 4:30 PM