The exception that is generated when Zoho CRM returns an error.
The following example generates a
ZohoException due to a non-existing table, and then displays the exception.
|
|---|
public void ThrowZohoException()
{
string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
ZohoConnection zohoConnection =
new ZohoConnection(
"Refresh Token=1000.a6fde76542bfbb5244a7e539d4390e72.87e34ea57023c2d0e7dcb9ce55e3e7f3;ClientId=1000.M4FJLKYTSED90LJHUTVMKKAA432RUK;ClientSecret=89a0ed79957808814cdb20b9765423efffa767d1d0");
ZohoCommand zohoCommand = new ZohoCommand(mySelectQuery,zohoConnection);
try
{
zohoCommand.Connection.Open();
}
catch (ZohoException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n");
}
} |
|
|---|
Public Sub ThrowZohoException()
Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
Dim zohoConnection As New ZohoConnection( _
"Refresh Token=1000.a6fde76542bfbb5244a7e539d4390e72.87e34ea57023c2d0e7dcb9ce55e3e7f3;ClientId=1000.M4FJLKYTSED90LJHUTVMKKAA432RUK;ClientSecret=89a0ed79957808814cdb20b9765423efffa767d1d0")
Dim zohoCommand As New ZohoCommand(mySelectQuery, zohoConnection)
Try
zohoCommand.Connection.Open()
Catch myException As ZohoException
MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
End Try
End Sub |