Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Silly beginner question - Initially load one record
Message
De
01/04/2005 10:44:51
 
 
À
31/03/2005 10:03:13
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01000328
Message ID:
01000671
Vues:
12
Never mind! I forgot to Instanciate my business object in the New event.


>I am new to MM.Net and .Net in general, so please bear with me. I have written my first MM.Net app and now feel empowered. However the first app was a "normal" type of maintenance app with navigation and selection based upon user entry (picklist). This form is not like that in that only one record should be available based upon an environment setting. I need to retrieve this record immediately after the form gets initial focus. This is a code snippet from my form.
>
>Imports System.Data
>Imports OakLeaf.MM.Main.Business
>Imports OakLeaf.MM.Main.Windows.Forms
>Imports WebStore.WebPresence.Business
>
>Public Class OrgMaint
>	Inherits OakLeaf.MM.Main.Windows.Forms.mmBusinessForm
>
>	Private oOrganization As WebStore.WebPresence.Business.Organization
>	Private dsOrganization As DataSet
>	Private lFirstShow As Boolean = True
>
>#Region " Windows Form Designer generated code "
>
>	Public Sub New()
>		MyBase.New()
>
>		'This call is required by the Windows Form Designer.
>		InitializeComponent()
>
>		'Add any initialization after the InitializeComponent() call
>
>	End Sub
>
>	'Form overrides dispose to clean up the component list.
>	Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
>		If disposing Then
>			If Not (components Is Nothing) Then
>				components.Dispose()
>			End If
>		End If
>		MyBase.Dispose(disposing)
>	End Sub
>
>	'Required by the Windows Form Designer
>	Private components As System.ComponentModel.IContainer
>
>	'NOTE: The following procedure is required by the Windows Form Designer
>	'It can be modified using the Windows Form Designer.
>	'Do not modify it using the code editor.
>	Friend WithEvents MmLabel1 As OakLeaf.MM.Main.Windows.Forms.mmLabel
>	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
>		Me.MmLabel1 = New OakLeaf.MM.Main.Windows.Forms.mmLabel
>		Me.SuspendLayout()
>		'
>		'MmLabel1
>		'
>		Me.MmLabel1.BindingSource = Nothing
>		Me.MmLabel1.BindingSourceMember = Nothing
>		Me.MmLabel1.ControlID = New System.Guid("00000000-0000-0000-0000-000000000000")
>		Me.MmLabel1.Location = New System.Drawing.Point(160, 128)
>		Me.MmLabel1.Name = "MmLabel1"
>		Me.MmLabel1.Size = New System.Drawing.Size(58, 16)
>		Me.MmLabel1.TabIndex = 0
>		Me.MmLabel1.Text = "hello world"
>		'
>		'OrgMaint
>		'
>		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
>		Me.ClientSize = New System.Drawing.Size(648, 518)
>		Me.Controls.Add(Me.MmLabel1)
>		Me.Name = "OrgMaint"
>		Me.Text = "Web Presence Customizer"
>		Me.ResumeLayout(False)
>
>	End Sub
>
>#End Region
>
>	Private Sub GetMyRecord()
>		If Me.lFirstShow = True Then
>			Me.dsOrganization = Me.oOrganization.GetorganizationByOrgId("0018")
>			Me.lFirstShow = False
>		End If
>	End Sub
>
>	Private Sub OrgMaint_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.GotFocus
>		Me.GetMyRecord()
>	End Sub
>End Class
>
>But when this form executes it bombs! with :
>
>Error creating window handle
>
>
>Help!
>
>Thanks
>
>Glenn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform