winforms - Quick Book Integration with C# Windows Application -


i have quick book application installed in system. , have created few vendors , customers list.

quick book: quickbooks simple start 2010 free edition

database : quickbooks database server manager

db version : 11.0.1.2584

computer name : sys13

from windows c# application, i'm trying add list of vendors , customer reading excel. i'm generating xml , based on excel inputs.

every thing ok. connectivity not happening between my c# app , quick book database.

i'm getting below error:

can't connect database. 

connection string : computer name=sys13;company data=demo vss;version=11.0.1.2584

code have tried connect:

     try      {            rp.openconnection("vendoradd", "vendoradd");            messagebox.show(connstring);            ticket = rp.beginsession(connstring);             response = rp.processrequest(ticket, input);            requestxml = input.tostring();            responsexml = response.tostring();       }      catch (system.runtime.interopservices.comexception ex)      {            messagebox.show("com error description = " + ex.message, "com error");            return;      }           {            if (ticket != null)            {                rp.endsession(ticket);            }            if (rp != null)            {                rp.closeconnection();            }       }; 

any ideas why? sample source codes regarding app?

thanks in advance,

the quickbooks integration requires application registered company quickbooks file (.qbw believe). in order connection take place, have run application directly against quickbooks installation while quickbooks running, , authorize application integration quickbooks. i'll dig relative links in follow-up edit.

edit here links pointed me in right direction: http://www.qodbc.com/qodbcconnect.htm http://www.ehow.com/how_8478505_add-integrated-application-quickbooks.html http://www.vtechnologies.com/kb.htm?prodid=2&kbid=797f8f94-3706-480d-a357-31b80ae2d011&

there other things going on well. inspect com exceptions getting , investigate codes directly. @ least point in direction. 1 tend com exception telling me don't have quickbooks open , running while i'm trying access it.

if in exception, need open quickbooks before try , connect it:

hresult: 0x80040430 

in general, though, code should following:

public ivendorretlist getvendors(string filepath, string appname) { var _sessionmanager = new qbsessionmanager(); _sessionmanager.communicateoutofprocess(true); _sessionmanager.openconnection2(string.empty, appname, enconnectiontype.ctlocalqbd); _sessionmanager.beginsession(filepath, enopenmode.omdontcare); _request = _sessionmanager.createmsgsetrequest("us", 12, 0); _request.appendvendorqueryrq(); //do somethign filter vendor query here. var response = _sessionmanager.dorequests(_request); var vendorlist = (ivendorretlist)response.responselist.getat(0).detail; return vendorlist; } 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -