Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to Integrate Quick Book old version 2003 with C# .net
I found some code according to quickbooks website

<a href="https://codeload.github.com/IntuitDeveloper/QBXML_SDK_Samples/zip/refs/heads/master
">https://codeload.github.com/IntuitDeveloper/QBXML_SDK_Samples/zip/refs/heads/master
</a>

private void connectToQB()
      {
          sessionManager = SessionManager.getInstance();

          maxVersion = sessionManager.QBsdkMajorVersion;


      }

the code run good in version 12
but in version 3 not work
<pre>error

quickbooks an error the version of Qbxml that was requested is not supported or is unknown

if any one have Idea pls reply. or if another way to connect QuickBooks 2003 using c#
thanks

What I have tried:

how to connect QuickBooks 2003 using c#
Posted
Updated 9-Jun-21 10:43am
Comments
SeeSharp2 9-Jun-21 9:42am    
If I were you I would ask QuickBooks.

i found this code and now i can make connection with Quickbooks but the items name is in Arabic it get back like this ?????????
i need help to convert
Description
to
utf8


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Interop.QBFC14;


QBSessionManager _MySessionManager = new QBSessionManager();
           _MySessionManager.OpenConnection2("", "Your App Name", ENConnectionType.ctLocalQBDLaunchUI);
         //  _MySessionManager.OpenConnection2("", "Your App Name", ENConnectionType.ctLocalQBD);
           _MySessionManager.BeginSession("", ENOpenMode.omDontCare);
           var version = QBFCLatestVersion(_MySessionManager);
           short ver = Convert.ToInt16(version);

            IMsgSetRequest itemRequestset = _MySessionManager.CreateMsgSetRequest("US", 13, 0);
           IItemQuery itemQuery = itemRequestset.AppendItemQueryRq();
           itemQuery.OwnerIDList.Add("0");
           IMsgSetResponse responseItemRq = _MySessionManager.DoRequests(itemRequestset);
           IResponseList itemResponseList = responseItemRq.ResponseList;

             IResponse itemResponse = itemResponseList.GetAt(0);

           ENResponseType responseType = (ENResponseType)itemResponse.Type.GetValue();
           IORItemRetList QBItemList = (IORItemRetList)itemResponse.Detail;
           for (int i = 0; i <= QBItemList.Count - 1; i++)
           {
               if (QBItemList.GetAt(i).ItemNonInventoryRet != null)
               {
                   IItemNonInventoryRet inventoryItem = QBItemList.GetAt(i).ItemNonInventoryRet;
                   string ListID = inventoryItem.ListID != null ? inventoryItem.ListID.GetValue() : "";
                   string ItemCode = inventoryItem.Name != null ? inventoryItem.Name.GetValue() : "";
                  // string Description = inventoryItem.FullName.GetValue() != null ? inventoryItem.FullName.GetValue() : "";
                   string Description = inventoryItem.FullName.GetValue();
                   Description= Utf16ToUtf8(Description);
                   string MPN = inventoryItem.ManufacturerPartNumber != null ? inventoryItem.ManufacturerPartNumber.GetValue() : "";
                   rt1.AppendText(ItemCode.ToString() + Environment.NewLine);
                   rt1.AppendText(Description.ToString() + Environment.NewLine);

               }
               else if (QBItemList.GetAt(i).ItemInventoryRet != null)
               {
                   IItemInventoryRet inventoryItem = QBItemList.GetAt(i).ItemInventoryRet;
                   string ListID = inventoryItem.ListID != null ? inventoryItem.ListID.GetValue() : "";
                   string ItemCode = inventoryItem.Name != null ? inventoryItem.Name.GetValue() : "";
                   // string Description = inventoryItem.SalesDesc != null ? inventoryItem.SalesDesc.GetValue() : "";
                   string Description = inventoryItem.SalesDesc.GetValue().ToString().ToUTF8();
                   string MPN = inventoryItem.ManufacturerPartNumber != null ? inventoryItem.ManufacturerPartNumber.GetValue() : "";
                   //  string Price = inventoryItem.SalesPrice.GetValue();
                   Description = Utf16ToUtf8(Description);
                   rt1.AppendText(ItemCode.ToString() + Environment.NewLine);

                   rt1.AppendText(Description.ToString() + Environment.NewLine);
               }
               else if (QBItemList.GetAt(i).ItemInventoryAssemblyRet != null)
               {
                   IItemInventoryAssemblyRet inventoryItem = QBItemList.GetAt(i).ItemInventoryAssemblyRet;
                  // customFieldsList = string ListID = inventoryItem.ListID != null ? inventoryItem.ListID.GetValue() : "";
                   string ItemCode = inventoryItem.Name != null ? inventoryItem.Name.GetValue() : "";
                   string Description = inventoryItem.SalesDesc.GetValue() != null ? inventoryItem.SalesDesc.GetValue() : "";
                   string MPN = inventoryItem.ManufacturerPartNumber != null ? inventoryItem.ManufacturerPartNumber.GetValue() : "";

                   rt1.AppendText(ItemCode.ToString() + Environment.NewLine);

                   rt1.AppendText(Description.ToString() + Environment.NewLine);
               }
               else if (QBItemList.GetAt(i).ItemServiceRet != null)
               {
                   IItemServiceRet inventoryItem = QBItemList.GetAt(i).ItemServiceRet;
                   // customFieldsList = string ListID = inventoryItem.ListID != null ? inventoryItem.ListID.GetValue() : "";
                   string ItemCode = inventoryItem.Name != null ? inventoryItem.Name.GetValue() : "";
                   Console.WriteLine(ItemCode);
                   Console.WriteLine(ItemCode);
                   rt1.AppendText(ItemCode.ToString() + Environment.NewLine);
                 //  rt1.AppendText(Description.ToString().ToUTF8() + Environment.NewLine);


               }
 
Share this answer
 
in your VS NUGet---> Interop.QBFC14
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900