Hi
I'm facing some problem with my web service. I tried to connect to SAP but it gave me an "System.Exception"
Public Function ConnectedToDatabase() As Boolean
Try
Dim oCompany as SAPbobsCOM.Company
oCompany = New SAPbobsCOM.Company
Dim lRetCode, lErrCode As Long
Dim sErrMsg As String
sErrMsg = ""
Session("g_server") = System.Configuration.ConfigurationManager.AppSettings("Server")
Session("g_companyDB") = System.Configuration.ConfigurationManager.AppSettings("CompanyDB")
Session("g_DBUserName") = System.Configuration.ConfigurationManager.AppSettings("DbUsername")
Session("g_DBPassword") = System.Configuration.ConfigurationManager.AppSettings("DbPassword")
Session("g_Username") = System.Configuration.ConfigurationManager.AppSettings("Username")
Session("g_Password") = System.Configuration.ConfigurationManager.AppSettings("Password")
oCompany.Server = Session("g_server")
oCompany.CompanyDB = Session("g_companyDB")
oCompany.DbUserName = Session("g_DBUSerName")
oCompany.DbPassword = Session("g_DBPassword")
oCompany.UserName = Session("g_Username")
oCompany.Password = Session("g_Password")
oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English
lRetCode = oCompany.Connect()
When the codes runs to the line IRetCode = oCompany.Connect(), it will return an error code -8006. Those session got the correct information from the web.config. Then exception is throw in.
I try restarting my com and restarting my suite manager. Usually this will solve the problem. However, it won't for this time. I hope will receive some solutions for my problem. Thanks for your time.
Edited by: Polytechnic Ngee Ann on Jun 29, 2009 9:17 AM