The exception that is generated when Zoho Books returns an error.
The following example generates a
ZohoBooksException due to a non-existing table, and then displays the exception.
|
|---|
public void ThrowZohoBooksException()
{
string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
ZohoBooksConnection ZohoBooksConnection =
new ZohoBooksConnection(
Refresh Token=1000.a6fde76542bfbb5244a7e539d4390e72.87e34ea57023c2d0e7dcb9ce55e3e7f);
ZohoBooksCommand ZohoBooksCommand = new ZohoBooksCommand(mySelectQuery,ZohoBooksConnection);
try
{
ZohoBooksCommand.Connection.Open();
}
catch (ZohoBooksException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n");
}
} |
|
|---|
Public Sub ThrowZohoBooksException()
Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
Dim ZohoBooksConnection As New ZohoBooksConnection( _
Refresh Token=1000.a6fde76542bfbb5244a7e539d4390e72.87e34ea57023c2d0e7dcb9ce55e3e7f)
Dim ZohoBooksCommand As New ZohoBooksCommand(mySelectQuery, ZohoBooksConnection)
Try
ZohoBooksCommand.Connection.Open()
Catch myException As ZohoBooksException
MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
End Try
End Sub |