Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2004, 10:22 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding a new record to a dataset

I am trying to add a record to a dataset that I have, the dataset itself is working fine and poulating the text boxes etc as required. However I am unable to add a new record the code I am using is below:-

  Dim tblauthors As DataTable
  tblauthors = dsdata.Tables("Jobs")

  Dim drCurrent As DataRow
  drCurrent = tblauthors.NewRow()

When I run this I get the error message:-

An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication4.exe

Additional information: Object reference not set to an instance of an object.

I am using an access database.

Thanks in Advance

Louisa

 
Old January 14th, 2004, 05:33 PM
Registered User
 
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It sounds like you are not initializing all of the fields in the record you are writing out.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding row to dataset in C# MAKO C# 2 March 11th, 2010 08:10 AM
how to add new record as first record in dataset [email protected] ASP.NET 1.0 and 1.1 Professional 4 April 21st, 2006 05:23 AM
adding to a dataset wilbur C# 2 April 16th, 2005 10:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.