Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 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 April 25th, 2006, 11:48 PM
Authorized User
 
Join Date: Mar 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do I write out a record to an SQL db table?

Visual Basic 2005 Express Edition:

I am trying to write out a record to an SQL database table:

Private Sub WriteOutRx()

Me.RxBindingSource.Current("PatientLastName") = PatientLastName <---Error on this line

Me.Validate()

Me.RxTableAdapter.Update(Me.RxDataSet.Rx)

End Sub

Below is the error message that I got:

NullReferenceException was Unhandled

Object variable or With block variable not set.

use the 'new' keyword to create an object instance.




 
Old April 26th, 2006, 05:16 PM
Registered User
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Verify the BindingSource in not empty.
You can do this by testing the BindingSource.Position property (must be greater than -1).







Similar Threads
Thread Thread Starter Forum Replies Last Post
populating a db table with a sql dataset(full) helloise C# 0 August 26th, 2008 08:54 AM
move record to another table in same DB Dejitan Classic ASP Basics 2 January 3rd, 2007 07:50 AM
Create record in linked SQL table Derek_05 Access VBA 3 June 1st, 2006 03:22 AM
Is It Possible to write record to DB Dwizz VB.NET 2002/2003 Basics 1 May 6th, 2005 07:16 AM
Adding a new record to a sql server DB morpheus VB How-To 6 August 6th, 2003 06:15 PM





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