QuickBooksException Class
The exception that is generated when QuickBooks Online returns an error.
The following example generates a
QuickBooksException due to a non-existing table, and then displays the exception.
public void ThrowQuickBooksException()
{
string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
QuickBooksConnection quickBooksConnection =
new QuickBooksConnection(
"Company Id=1440905870;Refresh Token=AB11590759756UCO8O6CpRQcAMP00sIANafgS8Y4RN10rpLJNM;Token Server=file://D:\\temp\\QuickBooksToken.txt");
QuickBooksCommand quickBooksCommand = new QuickBooksCommand(mySelectQuery,quickBooksConnection);
try
{
quickBooksCommand.Connection.Open();
}
catch (QuickBooksException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n");
}
}
Public Sub ThrowQuickBooksException()
Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
Dim quickBooksConnection As New QuickBooksConnection( _
"Company Id=1440905870;Refresh Token=AB11590759756UCO8O6CpRQcAMP00sIANafgS8Y4RN10rpLJNM;Token Server=file://D:\\temp\\QuickBooksToken.txt")
Dim quickBooksCommand As New QuickBooksCommand(mySelectQuery, quickBooksConnection)
Try
quickBooksCommand.Connection.Open()
Catch myException As QuickBooksException
MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
End Try
End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2