Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to get a field in related table
Message
 
À
22/08/2006 11:02:11
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Divers
Thread ID:
01146540
Message ID:
01147767
Vues:
19
Tony,

>Good so far but one more thing is happening, no errors show up in the code.
>However, when I run the app I'm getting a message
>"Object reference not set to an instance of an object."
>"Use the New keyword..."
>
>it's at the line
>lcDept = dsItems.Tables(0).Rows(0).Item("DeptMMC").ToString()
>
>I thought that 'dsItems' dataset was already set as an object, why do I have to set a New keyword? And what am I setting it to? Is it because the dsItems is in the business object?

I recommend setting a breakpoint on this line to see what's null. It may be that:

1. dsItems is null
2. There are no tables in dsItems
3. There are no rows in Tables(0)
4. There is no column named "DeptMMC" in the DataTable.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform