on 12-18-2007 10:56 PM
I am trying to connect to the company database as suggested in DIAPI in sap b1 sample codes...I am not able to do so...
Here is the code that i wrote in C#..
company = new Company();
company.Server = "servername";
company.CompanyDB = "Training";
company.UseTrusted = true;
company.language = BoSuppLangs.ln_English;
company.UserName = "";
company.Password = "";
int retcon = company.Connect();
if (retcon != 0)
{
MessageBox.Show("The connection with the database was not established.");
}
Hi Kim,
The UserName and Password must be set to values that match a user account in SAP Business One (eg a UserName of 'manager' with a password of 'manager' if you are using a test system). It doesn't matter whether you use a trusted connection or not, you must still set values to these properties (it's the DbUserName and DbPassword that don't need to be set if you use a trusted connection).
Kind Regards,
Owen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Kim,
company = new Company();
company.Server = "servername"; -->Give your server name here
company.CompanyDB = "Training";
company.UserName = "Manager"; -->your SBO USER login id
company.Password = "Manager"-->your SBO USER pwd
company.UseTrusted = true; -->When you use this no need to provide user id and pwd for database
company.language = BoSuppLangs.ln_English;
int retcon = company.Connect();
if (retcon != 0)
{
MessageBox.Show("The connection with the database was not established.");
}
OR you can use
company = new Company();
company.Server = "servername"; -->Give your server name here
company.CompanyDB = "Training";
company.language = BoSuppLangs.ln_English;
company.UserName = "Manager"; -->your SBO USER login id
company.Password = "Manager";-->your SBO USER pwd
company.DbUserName="Sa"-->Your Sql Server Login ID
company.DbPassword=""Sa"-->Your Sql Password
int retcon = company.Connect();
if (retcon != 0)
{
MessageBox.Show("The connection with the database was not established.");
}
Hope this helps you
Regards
Vishnu
Edited by: Vishnu Kumar Reddy on Dec 20, 2007 7:41 AM
Edited by: Vishnu Kumar Reddy on Dec 20, 2007 7:45 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.