Book a Demo

Author Topic: C# api, connect to server instead an EAP  (Read 4194 times)

Fabio Falci

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
C# api, connect to server instead an EAP
« on: March 09, 2012, 03:21:10 am »
Hi!
Can I connect to a server instead an EAP?

Code: [Select]
Repository r = new RepositoryClass();
r.OpenFile("test.eap");
// r.OpenServer("connectionString"); ?

Thanks in advance.
Fabio

Fabio Falci

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: C# api, connect to server instead an EAP
« Reply #1 on: March 09, 2012, 03:33:35 am »
The solution is to create an EAP shorcut and OpenFile this EAP.

* EAP shortcut: open EA, connect to server, go to 'File > Save Project Shortcut'.

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: C# api, connect to server instead an EAP
« Reply #2 on: March 23, 2012, 10:09:44 am »
From the "OpenFile()" EA help:


This is the main point for opening an Enterprise Architect project file from an automation client, and working with the contained objects.

If the required project is a DBMS repository, and you have created a shortcut .EAP file containing the database connection string, you can call this shortcut file to access the DBMS repository.

You can also connect to a SQL database by passing in the connection string itself instead of a filename. A valid connection string can be obtained from the Open Project dialog by selecting a recently opened SQL repository.

Parameters:

ยท Filename: String - the filename of the Enterprise Architect project to open.