Skip to Content

Missing connection string

Hi to all.

It's happening a strange thing on some my addons.

Today, the addons developed in VB.NET seems that B1 doesn't pass the connection string by command parameter .Infact the statements with Args(0) and System.Environment.GetCommandLineArgs.GetValue(1) throw an out of range exception.

Public Sub Main(ByVal Args() As String)

Dim oCatchingEvents As CatchingEvents = New CatchingEvents(Args(0), IDENTIFIER_STRING)

Dim oCatchingEvents As CatchingEvents = New CatchingEvents(System.Environment.GetCommandLineArgs.GetValue(1), IDENTIFIER_STRING)

End Sub

If I try some VB6 addons, these seems to work - I use the Command statement.

Please, what happen!!!

Can be a license problem?

Ciao. Nicola

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jul 21, 2005 at 11:01 AM

    Try this,

    (in VB .Net)

    Private Sub SingleSignOn()

    Dim SboGuiApi As SAPbouiCOM.SboGuiApi

    Dim sConnectionString As String

    '1. UI Sign On

    '//Get the Connection String

    '1b. This is for Add-On Purposes

    sConnectionString = Environment.GetCommandLineArgs.GetValue(1)

    'Connect to a running SBO Application

    SboGuiApi = New SAPbouiCOM.SboGuiApi

    SboGuiApi.Connect(sConnectionString)

    'Get an initialized application object

    SBO_App = SboGuiApi.GetApplication()

    (Your connection string will be retrieved like this :

    sConnectionString = Environment.GetCommandLineArgs.GetValue(1))

    That works just fine for me..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2005 at 12:28 PM

    Hi Martella,

    I've also faced this problem, and the connection string appeared to be removed by Visual Studio. Check if your connection string is in fact still in your <i>Configuration Properties > Debugging > Command Line Arguments</i>.

    Sometimes Visual Studio throws away his properties if you close VS wrong, or if VS chrashes (and sometimes I think microsoft builds in this 'features' to bother us :P)

    Good luck!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2005 at 11:13 AM

    Hi,

    also I have the same problem with VB.Net.

    System.Environment.GetCommandLineArgs.GetValue(1) throw an out of range exception</b>

    I would like to know if it is solved and how.

    Thank you very much

    Andy

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.