473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

NullReferenceException was unhandle when loop an object

6
Hi Everyone!
I got two form.
form 1 i ask the user a number of guest
form 2 i ask each guest their name, their age
i decide to make a loop base on the number of guest but then i got this error. NullReferenceException was unhandled
how to solve this...i underline under my code

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnBook_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBook.Click
  2.  
  3.         iTest = CInt(txtChildren.Text)
  4.         Do Until (iCounter = iTest) And (bIsNextClicked = True)
  5.             PassengersDetails(iCounter).ShowDialog()
  6.         Loop
  7.  
  8.     End Sub
Mar 15 '12 #1
1 1180
PsychoCoder
465 Expert Mod 256MB
I would start with putting a break point on line 4 to see what value ICounter holds.
Mar 17 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Matthew Louden | last post by:
The following ASP code yields the following error, but actually the new record is stored in database. The same error happens when the application deletes a record, such as sqlStmt ="delete from...
1
by: | last post by:
So, I am getting this really annoying error.. the SQL Statement executes perfectly in Query Analyzer.. all I am doing is basically duplicating a row (insert into select from) from one table back...
2
by: Arpan | last post by:
An ASP application updates a SQL Server database table after a Form is submitted after which the user is directed to another page that should display the updated records. If the code is ...
5
by: Paul Wilkinson | last post by:
How can I write a method that is called when an object goes out of scope? I've looked all over, so far I've only found discussions of how to write methods that don't = )
1
by: Morgan Cheng | last post by:
We know that object in .net platform get destructed by GC. The question is, when WebService object get destructed? Is it also destructed by GC? or it can be configured in IIS? Thanks
5
by: mackenzie | last post by:
Hello, I am looking for a little bit of help. I am trying to create a dynamically allocated object which contains one or more objects of type boost::pool<>. I get a compiler error when an object...
5
by: Sonasang | last post by:
Hi , I am creating a web page with ASP and Javascript.We have shared the foldres containg the code and all our team members are accessing the code. There is no problem for me when i run the...
7
vikas1111
by: vikas1111 | last post by:
Hi All.... I have created a form in which i call other forms from the main form .. When i click a perticular botton twice there is an error .. Can anyone help me to solve my problem.. The error...
4
rrocket
by: rrocket | last post by:
I am trying send information to the DB and the SP will return a recordset. The problem is that I keep getting this error (ADODB.Recordset error '800a0e78' Operation is not allowed when the object is...
1
by: govind161986 | last post by:
Dear All, I have a stored procedure in which I have used a temporary table which selects the value from two tables and display the result. When I run the stored procedure from Sql's query analyzer...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.