Application Crash while generating SQL script

Support

I've created ER diagrams and want to generate SQL scripts from them. Using the standard template (SQL DDL) and ticking "One file per diagram" works fine. However I want to generate from a different template. Generating from the custom template works fine if "One file per diagram" isn't ticked. If it is ticked then I get a crash System.NullReferenceException.

At first I thought my template might have an issue, but I get the same crash if I just duplicate the standard SQL DDL template and not make any changes to it.

27 February 2019 8:00:47 Daniel

Add Comment

Dusan Rodina - softwareideas.net 27 February 2019 8:14:31

Hello,

Could you please send us the whole error message to identify the reason of this problem. Thank you for your cooperation.

Daniel 27 February 2019 8:37:22

RE:

Hi,

It is a pop up message:

"Sorry, an error has occured...

What do you want to do?"

Then I click on "Details":

"System.NullReferenceException: Object reference not set to an instand of an object.

at

SoftwareIdeasModeler.Core.Generation.Templates.TemplateProcessor.ProcessOneFilePerDiagram()

at SoftwareIdeasModeler.Core.Generation.Templates.TemplateProcessor.Process()

at SoftwareIdeasModeler.Dialogs.Generating.SourceCode.SettingForm.Generate()

at SoftwareIdeasModeler.Dialogs.Generating.SourceCode.SettingForm.generateButton_Click(Object sender, EventArgs e)

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

Daniel 27 February 2019 8:39:16

RE: RE:

continued error details.....

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

OF=SoftwareIdeasModeler.MainForm

LastCmd=SoftwareIdeas.Common.Commands.CombinedCommand

OF=SoftwareIdeasModeler.Forms.Templates.SourceCode.Editing.CodeAutoCompleteForm

OF=SoftwareIdeasModeler.Controls.TabSwitch.ThumbnailWindow

OF=SoftwareIdeasModeler.Forms.Templates.SourceCode.Editing.CodeAutoCompleteForm

OF=SoftwareIdeasModeler.Forms.Templates.SourceCode.Editing.CodeAutoCompleteForm

OF=SoftwareIdeasModeler.Forms.Templates.SourceCode.Editing.CodeAutoCompleteForm

OF=SoftwareIdeasModeler.Dialogs.Generating.SourceCode.SettingsForm

Dusan Rodina - softwareideas.net 27 February 2019 21:34:20

The problem was identified and it will be fixed soon. There is a workaround for this problem. Please, open the Main.simt file (of your template) in Notepad and manually fix the element <files> to <files defaultName="DefaultFileName">

You can find Main.simt file on this path: C:\Users\{YOUR_USER_NAME}\AppData\Roaming\DusanRodina\SoftwareIdeasModeler\Templates\Code\SqlDdl\{YOUR_TEMPLATE_NAME}\Main.simt

I apologize for this inconvenience.

Daniel 28 February 2019 8:21:09

RE:

Hi

Thank you, the workaround works ok. The only issue now is the generated query isn't a .sql file anymore and its name is always DefaultFileName. So when I generate from multiple ER files, they all get overwritten due to the filename being the same.

For now I'll generate from one ER page at a time and manually rename the files after generation.

Thank you for the help.

Dusan Rodina - softwareideas.net 28 February 2019 9:12:27

RE: RE:

Hi,

It is possible to name each file by its diagram. You can do it when you modify the <files> element this way:

<files defaultName="{Name}.sql">