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

SAPbobsCOM.Company ASP C#

Buenos días;

Estoy haciendo una aplicación en ASP C#, y quiero conectarme a la Base de Datos de SAP mediante DI API Reference. pero el codigo que e utilziado era en visual basic y no se como convertirlo a C#

  1. Dim oCompany As SAPbobsCOM.Company
  2. Dim lRetCode, ErrorCode As Long
  3. Dim ErrorMessage As String
  4. Set oCompany = New SAPbobsCOM.Company
  5. oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008
  6. oCompany.DbUserName = "sa"
  7. oCompany.DbPassword = "********"
  8. oCompany.Server = "localhost"
  9. oCompany.CompanyDB = "SBODemoCL"
  10. oCompany.UserName = "manager"
  11. oCompany.Password = "manager"
  12. oCompany.UseTrusted = False
  13. lRetCode = oCompany.Connect()


Alguien podria ayudarme darme un logica de como hacerlo.


Gracias anticipadas.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on May 08, 2015 at 05:03 PM

    Hola

    Así

    1. SAPbobsCOM.Company oCompany = new SAPbobsCOM.Company();
    2. oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008;
    3. oCompany.DbUserName = "sa";
    4. oCompany.DbPassword = "SAP**";
    5. oCompany.Server = "sap9";
    6. oCompany.CompanyDB = "SBO9*****";
    7. oCompany.UserName = "manager";
    8. oCompany.Password = "*****";
    9. oCompany.UseTrusted = false;
    10. oCompany.language = SAPbobsCOM.BoSuppLangs.ln_Spanish_La;
    11. if (oCompany.Connect() != 0)
    12. {
    13. MessageBox.Show(oCompany.GetLastErrorDescription());
    14. }

    Saludos

    Add a comment
    10|10000 characters needed characters exceeded

    • En C#, las variables se definen

      <Tipo de dato> <Nombre variable>;

      También es posible setear el valor en la misma declaración

      <Tipo de dato> <Nombre variable> = <valor>

      Ejemplos

      int myNumero = 0;

      string myText = "Felipe";

      SAPbobsCOM.Company oCompany = new SAPbobsCOM.Company();

      SAPbobsCOM.Documents oDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoice);

      Etc.

      Saludos

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.