user3004443
user3004443

Reputation: 133

How to check if the connection has been established using SAP.net coonector

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

Answers (1)

Taylan Aydinli
Taylan Aydinli

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

Related Questions