Niraj Chapla
Niraj Chapla

Reputation: 2179

Connect to the Sparx EA project on SQL Server with C# code

I am relatively new to the Sparx EA. I am trying to evaluate the Sparx EA APIs. I am able to connect to the Sparx EA project stored in the .eap files using following C# code.

   r = new EA.Repository();
   bool isOpen = r.OpenFile("C:/Sparx-EA/Test Project.EAP");
   Element ele = r.GetElementByID(10);

This is giving me the element with Id 10.

Now I have transferred the project to the MS SQL Server, and created element on that project on MS SQL Server.

Now, I wanted to connect to the project that is stored on MS SQL Server with C# code. I have tried to find out the document and examples given by the Sparx, but they are most of showing the opening project from file.

Can some one help me to connect to the project stored on the SQL Server using C# code.

Upvotes: 3

Views: 1128

Answers (1)

Geert Bellekens
Geert Bellekens

Reputation: 13784

You can either supply a connectionstring directly, or create a "shortcut" eap file using File|Save Shortcut

This will create a small txt file with .eap extension that contains the connectionstring. You can then use this .eap file for your r.OpenFile operation.

Upvotes: 4

Related Questions