I generated a TXP model using Toad Data Modeler 6.1
I launched the command: TDM.exe /regserver
I written and executed automation script to perform various Toad Data Modeler tasks.
How to call TDM from C# application? I tried to execute the following csharp code:
{
Type toadType = System.Type.GetTypeFromProgID(“TDM.App”); dynamic App = System.Activator.CreateInstance(toadType);
while (!App.Application.IsPackagesLoaded) { Thread.Sleep(1000); }
var Model = App.OpenModelFromFile(“C:\MyProject.txp”);
// TO DO…
}
but The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)).
How can I solve this problem, anyone knows? Thanks very much!
could you provide fully version number? (6.1 can be 32b, 64b, Full or Freeware).
I tried only calling from JScript(I don’t have C#) on TDM 6.1.3.26 and it is works. It can be same as C#. Did you try some simple JScript? I attached one example(need to change path to model and output folder in it).
I also tried calling from JScript on TDM 6.1.4.4 (Freeware, 64 bit) and it is works. I’m trying to create an Automation Client for Toad in C#, not in Jscript o VBScript. When i execute c# code written previously, the server threw an exception on the third line “while (!App.Application.IsPackagesLoaded)”. In your opinion, is it possible?