Skip to Content
author's profile photo Former Member
Former Member

SAP sbo company variables for login

I have the following code for connecting to the SAP server.

try

{

_SboCompany.Server = "KINYANJUIKAMAU";

_SboCompany.DbServerType = BoDataServerTypes.dst_MSSQL2008;

_SboCompany.LicenseServer = "localhost:30000";

_SboCompany.language = BoSuppLangs.ln_English;

_SboCompany.UserName = "manager";

_SboCompany.Password = "1234";

_SboCompany.CompanyDB = "EIMPayroll";

_SboCompany.DbUserName = "sa";

_SboCompany.DbPassword = "sekonda";

_SboCompany.UseTrusted = false;

_SboCompany.Connect();

if (_SboCompany.Connected)

{

MessageBox.Show("Log in Successful");

}

else

{

MessageBox.Show("Log in Not Successful");

}

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);

}

How do I change the code so that SboCompany username and password can be set to take in variables from textfields, ie login instead of hardcoding the values?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2012 at 12:37 PM

    Hi,

    First sample (01. Basic Operations) from SDK shows how to do it.

    Regards,

    Eric

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2012 at 03:15 AM

    Hi Kinyanjui,

    You can refer to Eric post.

    Here's the exact path (C:\Program Files\SAP\SAP Business One SDK\Samples\COM DI\CSharp\01.BasicOperations)

    Regards,

    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.