Subscribe to this thread
Home - General / All posts - Manifold 9, issue when runing vb.NET program
auerf5 post(s)
#05-Aug-22 08:30

In the attached program I am having the following issue.

Using forms the program initializes correctly and the subrutine SQL_test(1) is working correctly. But when you push the button "What item is selected", which activates subroutine SQL_test(2), i get the following error message: "Unhandled exception has occured in a component in your application"; some of the details below:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

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

at Script.ComboBoxSample.SQL_test(Int32 cifra)

at Script.ComboBoxSample.showSelectedButton_Click(Object sender, EventArgs e)

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

.....

I suspect the program crashes at this line:

table = db.Run( "SELECT * FROM [RPE_OBCINE_ime]" )

Hopefuly you can help me with this issue,

Best regards and thank you

Attachments:
Test_db_run.map

adamw


10,391 post(s)
#05-Aug-22 13:59

The script runs the form modeless, so here's what happens: the script starts -> the form shows -> the script ends -> the form remains on the screen and keeps responding to events, but it can no longer call into Manifold because Manifold saw that the script ended and closed the communication channel to it.

Change form.Show() to form.ShowDialog(). This will change the process to: the script starts -> the form shows and does not return control until the user closes it -> the script ends.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.