473,408 Members | 2,832 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,408 software developers and data experts.

Error:Object reference not set to an instance of an object

hi all

i know this is common error. i ve been through many solutions.

But i am not able to solve it.

here is my error
************************************************** **********************************
System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 22: {
Line 23:
Line 24: sID = Convert.ToInt32(Request.QueryString["Edit"].ToString());
Line 25: if (Request.QueryString["Edit"] == "")
Line 26: Function = "Save";


Source File: c:\Inetpub\wwwroot\VApp\Forms\AccountAddNew.aspx.c s Line: 24


************************************************** ***************

my code is

************************************************** ****************

public partial class Forms_AccountAddNew : Vakakis.UI.Forms.Base.AccountBR
{
public string Function = "";
public int sID = 0;

protected void Page_Load(object sender, EventArgs e)
{

sID = Convert.ToInt32(Request.QueryString["Edit"].ToString());
if (Request.QueryString["Edit"] == "")
Function = "Save";
else
Function = "Update";

if (Function == "Update")
{
AccountEntity a = (AccountEntity)this.selectOneRecord(sID);
txtAccountNo.Text = a.Accountno;
txtAccountHolder.Text = a.Accountholder;
txtBankName.Text = a.Bankname;
txtBankAddress.Text = a.Bankaddress;
txtSwift.Text = a.Swift;
txtIBANCode.Text = a.Ibancode;
}
}
************************************************** **********************

Any help would be appreciated..

Thanx..
mady
Jan 25 '07 #1
2 1223
radcaesar
759 Expert 512MB
Debug and check whether Request.QueryString["Edit"].ToString() method will return anything or NULL

:)
Jan 25 '07 #2
Debug and check whether Request.QueryString["Edit"].ToString() method will return anything or NULL

:)

thanx...alot..
yes it actually sometimes when i open this page without giving the querystring it shows this problem. so i have to return empty Querystring.

thanx :)
Jan 25 '07 #3

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

Similar topics

1
by: Romeo Disca | last post by:
Hello newsgroup, i'm new to xml - what's wrong with this piece code here? i have these two files: test.xml ---- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE a SYSTEM "test.ent"
1
by: Paloma GarcĂ­a | last post by:
Dear all, I have created personalized configuration sections in my web project following the instructions described in this page...
0
by: Michael Chong | last post by:
I have an (exe) executable program created in VB.NET 2003 that calls to a MFC DLL written in VC++.NET 2003. I always get an error msg "NullReferenceException: Object Reference Not Set to an...
0
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
2
by: Giovanni Bassi | last post by:
Hello All, I have encountered a problem. I am using visual inheritance and my base form adds an event handler on Form Load using the AddHandler Keyword. The problem is that if the Event...
11
by: westplastic | last post by:
This one is driving me insane. The script works perfect on Firefox, but Internet Explorer keeps complaining about "Error Object Expected" and stuff like that. I've run it through Firefox's Java...
2
by: facole | last post by:
I'm new to the .net environment. What I'm trying to do is to have an html page call a .aspx application and pass certain information. I have a field in the html file <input type="text"...
8
by: ipy2006 | last post by:
In my HTML I have, <input type="button" class="cartonsumkey" value="Sum Cartons" onclick="sumup(this);" /> In an external file that is called in Head area, I have, function sumup( o ) { ...
2
by: rksadhi | last post by:
/*Geting error ---object reference not set to an instance---at bold line----plz reply asap thanks in advance*/ cmd = new OleDbCommand ("SELECT e.emp_id,e.email, m.email AS Email FROM emp_details...
6
by: Patient Guy | last post by:
I am a newcomer to using PHP but not to programming (C, C++, Javascript). I am playing around with classes and wanted to make a function that has a method simply for producing either plain text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.