Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: jan.izyk on November 06, 2015, 10:27:01 pm
-
Hi all,
I've got again a question about the C# API of EA.
With the command
myRepository.SQLQuery(...)
I can execute select-statements to the database.
But with this function I can't execute something like insert-into statements.
But at the scripting-interface there is the function Repository.Execute which can execute insert-into statements.
So my question is:
Is there any possibility to execute insert-into/update/... statements via the C# API like in the scripts?
Regards
Jan
-
As you said: Repository.Execute. This is completely undocumented and unsupported and misuse of it can damage your repository. Know what you are doing! And no question: you will not get any support for it from Sparx.
q.
-
Hi querty,
thanks for your reply.
Now I have seen the Execute-function in the interface IDualRepository.
But I can't get access to this function when myRepository is from type
EA.Repository.
So do you know, how I can get access to this function?
And thanks for the hint. I know, that it is dangerous to change the database directly. But sometimes it has to be done by this way.
-
Hi Jan,
Just go ahead and call Repository.Execute(). The code will compile and run perfectly fine.
/Uffe
-
Outsch. Now I've got it.
In the autocompletition-window in Visual Studio, the function isn't seen.
I have to execute it with MY repository and not as a static function Execute of the Namespace Repository.
As a small example-function for everyone who doesn't have a clue like me
void executeSqlStatement(EA.Repository myRepository, string mySqlStatement)
{
myRepository.Execute(mySqlStatement);
}
Thanks to you q and Uffe.