The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Exception when opening "Record Template Input" if Initial Catalog is not specified

Last post 02-15-2007, 4:06 PM by Mike.Griffin. 1 replies.
Sort Posts: Previous Next
  •  02-12-2007, 7:34 PM 244

    Exception when opening "Record Template Input" if Initial Catalog is not specified

    I am using "DotNetNuke ASCX Administrative Grids Template Suite" 1.5.0 and created a project, then for selected template instance saved my selections via   "Record Template Input".
    After this when I tried to open "Record Template Input" again, I've got:

    Object reference not set to an instance of an object.Void lboxTables_SelectedIndexChanged(System.Object, System.EventArgs)Call StackSystem.NullReferenceException: Object reference not set to an instance of an object.   at MyUI.lboxTables_SelectedIndexChanged(Object sender, EventArgs e) in c:\Program Files\MyGeneration\$ZEUS$DEBUG$ec3a4795-fc77-468e-a2e7-5c706b6d945d.cs:line 1291   at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)   at System.Windows.Forms.ListBox.ClearSelected()   at System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)   at MyUI.BindFromProjectData() in c:\Program Files\MyGeneration\$ZEUS$DEBUG$ec3a4795-fc77-468e-a2e7-5c706b6d945d.cs:line 216   at MyUI.MyUI_Load(Object sender, EventArgs e) in c:\Program Files\MyGeneration\$ZEUS$DEBUG$ec3a4795-fc77-468e-a2e7-5c706b6d945d.cs:line 130   at System.Windows.Forms.Form.OnLoad(EventArgs e)   at System.Windows.Forms.Form.OnCreateControl()   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)   at System.Windows.Forms.Control.CreateControl()   at System.Windows.Forms.Control.WmShowWindow(Message...

    After a bit of debugging the template I found that
    private void lboxTables_SelectedIndexChanged(object sender, System.EventArgs e)
    doesn't handle case when this.lboxTables.SelectedItem is null.
    I've fixed the code by adding one line(in Bold)

          private void lboxTables_SelectedIndexChanged(object sender, System.EventArgs e)

          {

                MyMeta.ITable newTable = this.lboxTables.SelectedItem as MyMeta.ITable;

                if( null == newTable) return;//MNF

                if(table == null || table.Name != newTable.Name)
    ...

    and no exceptions are thrown now. But it opened master database instead of database that was saved in template instance.

    Further debugging showed, that it is nesessary in connection string to specify Initial Catalog=MyDatabase.
    Without Initial Catalog  the template instance settings are not restored.

    Could you please fix it for the new version of template.


    Michael Freidgeim
    Blog: http://geekswithblogs.net/mnf/
  •  02-15-2007, 4:06 PM 327 in reply to 244

    Re: Exception when opening "Record Template Input" if Initial Catalog is not specified

    Great job debugging, I can tell you're a hard core MyGeneration user. The ASPX templates you are using are going to replaced by an entirely new set this late summer / fall.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
View as RSS news feed in XML