Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 25th, 2006, 11:48 PM
Authorized User
Join Date: Mar 2006
Location: , , .
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



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.

Reply With Quote
  #2 (permalink)  
Old April 26th, 2006, 05:16 PM
Registered User
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

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

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 10:02 PM.

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