ExactTargetException Class
The exception that is generated when ExactTarget returns an error.
The following example generates a
ExactTargetException due to a non-existing table, and then displays the exception.
public void ThrowExactTargetException()
{
string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
ExactTargetConnection exactTargetConnection =
new ExactTargetConnection(
"user=MyCompanyAdmin;password=mypassword;url=https://webservice.s7.exacttarget.com/Service.asmx;");
ExactTargetCommand exactTargetCommand = new ExactTargetCommand(mySelectQuery,exactTargetConnection);
try
{
exactTargetCommand.Connection.Open();
}
catch (ExactTargetException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n");
}
}
Public Sub ThrowExactTargetException()
Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
Dim exactTargetConnection As New ExactTargetConnection( _
"user=MyCompanyAdmin;password=mypassword;url=https://webservice.s7.exacttarget.com/Service.asmx;")
Dim exactTargetCommand As New ExactTargetCommand(mySelectQuery, exactTargetConnection)
Try
exactTargetCommand.Connection.Open()
Catch myException As ExactTargetException
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