cancel
Showing results for 
Search instead for 
Did you mean: 

First attempt at Compile, HelloWorld failure!

Former Member
0 Kudos

Hi Forum,

Trying to develop in a long time.

My environment is SAP B1 8.8 Patch 18. I opened the HelloWorld C# shipped sample in VS2010. Clicked on Green arrow to run.

VS did convert the project to latest one. It is the UI API HelloWorld sample.

==============================================================================

This is the error I am getting at this statement - SboGuiApi.Connect( sConnectionString );

System.Runtime.InteropServices.COMException was unhandled

Message=Connection - Could not find SBO that match the connection string

Source=""

ErrorCode=-7202

StackTrace:

at SAPbouiCOM.SboGuiApiClass.Connect(String ConnectionStr)

at HelloWorld.SetApplication() in C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\01.HelloWorld\HelloWorld.cs:line 63

at HelloWorld..ctor() in C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\01.HelloWorld\HelloWorld.cs:line 79

at SubMain.Main() in C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\01.HelloWorld\SubMain.cs:line 24

at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

InnerException:

==========================

Could someone help me compile my frist program in SAP B1 SDK. Thank you.

Edited by: Syed Aleem on Feb 24, 2011 6:41 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Aleem

Try This.....

In Class


Public Class test
    Private WithEvents SBO_Application As SAPbouiCOM.Application
    Private oForm As SAPbouiCOM.Form
    Private Sub SetApplication()
        Dim SboGuiApi As SAPbouiCOM.SboGuiApi
        Dim sConnectionString As String
        SboGuiApi = New SAPbouiCOM.SboGuiApi
        sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
        SboGuiApi.Connect(sConnectionString)
        SBO_Application = SboGuiApi.GetApplication()
    End Sub
    Private Sub message()
        SBO_Application.MessageBox("Hello World!!")
    End Sub
    Public Sub New()
        MyBase.New()
        SetApplication()
        message()
    End Sub
End Class

In Module


Module submain
    Public Sub main()
        Dim otest As New test
        System.Windows.Forms.Application.Run()
    End Sub
End Module

and also set the connection property

Former Member
0 Kudos

Hi Shafi, I will try that over the weekend.

Thanks for your help.

Former Member
0 Kudos

Hi,

Do you have B1 client installed?

Thanks,

Gordon

Former Member
0 Kudos

Hi Gordon,

Yes, I do have client installed. Do I need B1DE? What is it?

I have also installed all components such as SDK, UI, DI etc. Client, Server and DB all on same machine. Thanks.