我正在尝试通过Quickbooks POS SDK将C#程序与Quickbooks POS集成。我安装了Quickbooks,Quickbooks SDK,Quickbooks POS和Quickbooks POS SDK。
当以下代码命中“sessionManager.BeginSession(”“);”时我收到错误消息“错误读取btnHelp.BorderColorSelected:Property 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();
}
}
}
答案 0 :(得分:1)
我不确定你还需要答案, 但可能需要在sessionManager.BeginSession()方法中设置连接字符串:
string connectionString = "Computer Name=WORKPC;Company Data=YourQBCompany;Version=10";
sessionManager.BeginSession(connectionString)
请参阅QB POS SDK开发指南,特别是使用Begin Session方法:http://dev.developer.intuit.com/POSSDK-Current/doc/pdf/QBPOS_ProgramGd.pdf
答案 1 :(得分:0)
还请确保公司文件处于多用户模式。