How to choose the company database name of QuickBooks

338 views Asked by At

I am creating silverlight application and integration Quickbooks data using QBFC.

I am browsing company database name from silverlgiht application which is opened in Quickbooks. When i do that i am getting error like File in use.

How can I get file name from browse button which is opened in Quick-books.

I have followed below code to start the quick-book secession.

  sessionManager.OpenConnection( "", "Account sample" );


  sessionManager.BeginSession( Filename, ENOpenMode.omDontCare );
1

There are 1 answers

0
Hpjchobbes On

The BeginSession call should be replaced with the file name that the user selected with your open file dialog. I would also suggest using OpenConnection2 if you're using the newest SDK. Here's a sample, though I've not really used Silverlight:

OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "QuickBooks Files (*.qbw)|*.qbw";
if(dlg.ShowDialog() == true)
{
    sessionManager.OpenConnection2("","Account sample", ENConnectionType.ctLocalQBD);
    sessionManager.BeginSession(dlg.File.FileName, ENOpenMode.omDontCare);

}