【发布时间】:2013-08-10 06:50:26
【问题描述】:
我的系统中安装了Quick book application。而且我创建的供应商和客户列表很少。
快速书:QuickBooks Simple Start 2010 Free Edition
数据库:QuickBooks Database Server Manager
数据库版本:11.0.1.2584
计算机名:SYS13
在我的 Windows C# 应用程序中,我试图通过阅读 Excel 添加供应商和客户列表。我正在生成 XML 并基于 Excel 输入。
一切正常。但是My C# app 和Quick Book Database 之间没有发生连接。
我遇到以下错误:
Can't connect to the database.
连接字符串:Computer Name=SYS13;Company Data=Demo VSS;Version=11.0.1.2584
我尝试连接的代码:
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;
}
finally
{
if (ticket != null)
{
rp.EndSession(ticket);
}
if (rp != null)
{
rp.CloseConnection();
}
};
任何想法为什么?有关于这个应用程序的示例源代码吗?
提前致谢,
【问题讨论】:
标签: c# winforms database-connection connection-string quickbooks