Solved

VB.net SAP Connector Error in converting C# to VB.net

Posted on 2013-12-14
6
1,282 Views
Last Modified: 2013-12-19
Hi I am getting the error below on the line marked ERROR HERE in the following VB.net code, which I converted using an online tool from the C# code below.

Error      3      Class 'SAPSystemConnect' must implement 'Event ConfigurationChanged(destinationName As String, args As RfcConfigurationEventArgs)' for interface 'SAP.Middleware.Connector.IDestinationConfiguration'.

Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports SAP.Middleware.Connector


Public Class SAPSystemConnect

    Implements IDestinationConfiguration 'ERROR HERE
    Public Function ChangeEventsSupported() As Boolean
        Throw New NotImplementedException()
    End Function

    Public Event ConfigurationChanged As RfcDestinationManager.ConfigurationChangeHandler

    Public Function GetParameters(destinationName As String) As RfcConfigParameters
        Dim parms As New RfcConfigParameters()
        If "Dev".Equals(destinationName) Then
            parms.Add(RfcConfigParameters.AppServerHost, "000.000.000.000")
            parms.Add(RfcConfigParameters.SystemNumber, "95")
            parms.Add(RfcConfigParameters.User, "sap_user")
            parms.Add(RfcConfigParameters.Password, "xxxxxxxxxx")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "EN")
            parms.Add(RfcConfigParameters.User, "5")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "600")
        End If

        Return parms

    End Function

End Class



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SAP.Middleware.Connector;

namespace SAP_Connect_CSharp
{
    class SAPSystemConnect:IDestinationConfiguration
    {
        public bool ChangeEventsSupported()
        {
            throw new NotImplementedException();
        }

        public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged;

        public RfcConfigParameters GetParameters (string destinationName)
        {
            RfcConfigParameters parms = new RfcConfigParameters();
            if ("Dev".Equals(destinationName))
            {
                parms.Add(RfcConfigParameters.AppServerHost, "000.000.000.000");
                parms.Add(RfcConfigParameters.SystemNumber, "95");
                parms.Add(RfcConfigParameters.User, "sap_user");
                parms.Add(RfcConfigParameters.Password, "xxxxxxxxxx");
                parms.Add(RfcConfigParameters.User, "10");
                parms.Add(RfcConfigParameters.User, "EN");
                parms.Add(RfcConfigParameters.User, "5");
                parms.Add(RfcConfigParameters.User, "10");
                parms.Add(RfcConfigParameters.User, "600");
            }

            return parms;

        }

    }
}
0
Comment
Question by:murbro
  • 3
  • 2
6 Comments
 
LVL 22

Expert Comment

by:p_davis
Comment Utility
I would have to think that you are not implementing all the items in the interface.
0
 

Author Comment

by:murbro
Comment Utility
I should have mentioned that I also get the following two errors
Error      4      Class 'SAPSystemConnect' must implement 'Function ChangeEventsSupported() As Boolean' for interface 'SAP.Middleware.Connector.IDestinationConfiguration'.
Error      5      Class 'SAPSystemConnect' must implement 'Function GetParameters(destinationName As String) As RfcConfigParameters' for interface 'SAP.Middleware.Connector.IDestinationConfiguration'.
0
 
LVL 22

Assisted Solution

by:p_davis
p_davis earned 250 total points
Comment Utility
those are the methods you need to implement to get rid of the errors- if you are using visual studio and you click on the interface name there should be a blue box that appears underneath the first letter... if you click that it will give you options to implement and stub in the methods for you.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
Comment Utility
VB uses a different syntax to declare implementations:

Public Event ConfigurationChanged(destinationName As String, args As Object) Implements SAP.Middleware.Connector.IDestinationConfiguration
0
 

Author Comment

by:murbro
Comment Utility
Thanks James. How would the entire piece of code look with your changes? I can't seem to get it right
I tried the following and got a "Type expected" error on "SAP.Middleware.Connector.IDestinationConfiguration"

Public Class SAPSystemConnect

    Public Function ChangeEventsSupported() As Boolean
        Throw New NotImplementedException()
    End Function

    Public Event ConfigurationChanged(destinationName As String, args As Object) Implements SAP.Middleware.Connector.IDestinationConfiguration

    Public Function GetParameters(destinationName As String) As RfcConfigParameters
        Dim parms As New RfcConfigParameters()
        If "Dev".Equals(destinationName) Then
            parms.Add(RfcConfigParameters.AppServerHost, "000.000.000.000")
            parms.Add(RfcConfigParameters.SystemNumber, "95")
            parms.Add(RfcConfigParameters.User, "sap_user")
            parms.Add(RfcConfigParameters.Password, "xxxxxxxxxx")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "EN")
            parms.Add(RfcConfigParameters.User, "5")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "600")
        End If

        Return parms

    End Function

End Class
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks for the help
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now