Reputation: 133
I am trying to connect to my clients SAP system. I am using the following code to connect, but how do i come to know that the connection has been successfully established.
protected void Page_Load(object sender, EventArgs e)
{
try
{
SAPSystemConnect sapCfg = new SAPSystemConnect();
RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);
RfcDestination rfcDest = null;
rfcDest = RfcDestinationManager.GetDestination("Dev");
}
catch (Exception ex)
{
lbl.Text=ex.Message;
}
}
Upvotes: 0
Views: 1532
Reputation: 4363
If the connection doesn't throw an exception, you'll know that the connection has been established. If there is a problem with the connection, the class will throw an appropriate exception.
Upvotes: 1