none
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

Answers

All replies