Skip to Content
0
Former Member
Aug 28, 2012 at 10:07 AM

SAP sbo company variables for login

24 Views

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?