Quickbooks POS SDK怪异的btnHelp BeginSession错误

本文关键字:btnHelp BeginSession 错误 POS SDK Quickbooks | 更新日期: 2023-09-27 18:10:59

我试图通过Quickbooks POS SDK集成一个c#程序与Quickbooks POS。我有Quickbooks, Quickbooks SDK, Quickbooks POS和Quickbooks POS SDK安装。

当下面的代码碰到"sessionManager.BeginSession(");"我得到的错误信息是"读取btnHelp错误"。BorderColorSelected:属性BorderCo。不是错别字,以BorderCo结尾。

谁来帮帮我!

using System;
using System.Net;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using Interop.qbposfc3;
namespace POSTest2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void CustomerAdd()
        {                        
            QBPOSSessionManager sessionManager = new QBPOSSessionManager();
            IMsgSetRequest request = sessionManager.CreateMsgSetRequest(3, 0);
            request.Attributes.OnError = ENRqOnError.roeContinue;
            BuildItemInventoryAddRq(request);
            sessionManager.OpenConnection("appID", "Application");
            sessionManager.BeginSession("");
            IMsgSetResponse response = sessionManager.DoRequests(request);
            sessionManager.EndSession();
            sessionManager.CloseConnection();
        }
        private void BuildItemInventoryAddRq(IMsgSetRequest request)
        {
            IItemInventoryAdd ItemInventoryAddRq = request.AppendItemInventoryAddRq();
            ItemInventoryAddRq.ALU.SetValue("M9ine");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            CustomerAdd();
        }
    }
}

Quickbooks POS SDK怪异的btnHelp BeginSession错误

我不确定你是否还需要一个答案,但是你可能需要在sessionManager.BeginSession()方法中设置连接字符串:

string connectionString = "Computer Name=WORKPC;Company Data=YourQBCompany;Version=10";
sessionManager.BeginSession(connectionString)

请参阅QBPOS SDK开发指南,特别是使用开始会话方法:http://dev.developer.intuit.com/POSSDK-Current/doc/pdf/QBPOS_ProgramGd.pdf

还请确保公司文件处于多用户模式。