on 02-24-2011 11:32 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Do you have B1 client installed?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
10 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.