Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object reference not set to an instance of an object
Message
From
24/02/2006 11:39:55
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
23/02/2006 21:28:56
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01098757
Message ID:
01098938
Views:
16
Hello Rex,

Looking at BindControlToData(DataSet ds, String tableName, String fieldName), I would suggest one of the following is happening when evaluating ds.Tables[tableName].Rows[0][fieldName]:

1. ds.Tables doesn't contain the table it's referencing
2. There are no rows in that datatable (so Rows[0] isn't an object.
3. The field referenced doesn't exist in that datatable.

If none of this rings a bell, put a breakpoint in that method and see which one is causing the error.

Hope that helps,
---J

>All,
>
>I have a simple entry form similar to the Order Edit form that gives the above message with the following trace:
>
>
>[NullReferenceException: Object reference not set to an instance of an object.]
> OakLeaf.MM.Main.Web.UI.WebControls.mmTextBox.BindControlToData(DataSet ds, String tableName, String fieldName) +655
> OakLeaf.MM.Main.Web.UI.mmWebBindingStrategySimple.BindData(ImmWebBindingSimple mmControl, mmBusinessObject bizObj, Boolean bindBack, mmBusinessStateChangeEventArgs e) +692
> OakLeaf.MM.Main.Web.UI.mmWebBindingStrategySimple.BindData(ImmWebBindingSimple mmControl, mmBaseBusinessObject bizObj, Boolean bindBack, mmBusinessStateChangeEventArgs e) +208
> OakLeaf.MM.Main.Web.UI.WebControls.mmTextBox.OnBindData(mmBaseBusinessObject bindingSource, mmBusinessStateChangeEventArgs e, Boolean bindBack) +189
> OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.BindControl(ImmWebBinding control, String bindingSource, String bindingMember) +482
> OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.RegisterBoundControl(ImmWebBinding boundControl) +448
> OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.OnBubbleEvent(Object source, EventArgs e) +153
> System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
> OakLeaf.MM.Main.Web.UI.WebControls.mmTextBox.OnLoad(EventArgs e) +153
> System.Web.UI.Control.LoadRecursive() +74
> System.Web.UI.Control.LoadRecursive() +158
> System.Web.UI.Control.LoadRecursive() +158
> System.Web.UI.Control.LoadRecursive() +158
> System.Web.UI.Control.LoadRecursive() +158
> System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3036
>
>
>Help!!!
Previous
Reply
Map
View

Click here to load this message in the networking platform