473,387 Members | 1,517 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,387 software developers and data experts.

System.NullReference Exception

i have written the following code to call a method in a class like

in the aspx.cs page
List<string> surls = new List<string>();

Cweb.GetMainUrls(document,ref surls);
Response.Write(surls);


in the Cweb Class page the coding is like

public static void GetMainUrls(Htmldocument doc,ref List<string> urls)
{
//Some functionalities
}

i get the following error when i run the application like

System.NullReference Exception
object reference not set to an instance

so because of this error my method is not getting called from the class and hence no result

can anyone help me out in finding like why my method was not called

i google through several sites and found that
this may be due to the fact that the "surls" are null and hence the method was not called
i dont follow these sequence

so anybody plz help me on this regard
thanks
Rama
May 10 '07 #1
1 1467
Motoma
3,237 Expert 2GB
This exception is probably being thrown inside GetMainUrls(). Put a check in place the handle a null value for urls, and initialize any null strings inside urls before proceeding with the function.
May 10 '07 #2

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

Similar topics

0
by: sergi | last post by:
Hi there, I am getting a System.NullReference exception when calling an unmanaged method CreateClassEnumerator. I am really new to Interop, so that I am having trouble finding out a solution....
2
by: Larry Re | last post by:
I've written a small C# app which appears to work perfectly except for the fact that I get a NullReference exception when I close the form using the red 'X' in the upper right hand corner of the...
5
by: Vitling | last post by:
For no apparent reason, a NullReference exception is thrown in system.dll (System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback). Since I only get a disassembly from Visual Studio, it...
6
by: Arvind | last post by:
Hi, How do u handle this error other than Try Catch method, is there anything like isDBNull() or something on those like so that i can check for the value of the object and take some action as...
0
by: studio60podcast | last post by:
I'm defining the ItemUpdating event for a DetailsView control, but when I try to access the e.NewValues collection, it's throwing a NULLReference exception. Any thoughts? <asp:DetailsView...
4
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ...
0
by: =?Utf-8?B?RGlzcEV2ZW50QWR2aXNlIGZhaWxzIHdpdGggMHg4 | last post by:
Hi, I have a beginner's question and I'm not even sure whether it's an asp question, an Exchange server question or an x64 question... I've been experimenting with HttpModules. I want to use one in...
2
by: ganeshvkl | last post by:
i got error " An unhandled exception of type 'System.NullReferenceException' occurred in system.data.dll " when i run my VB.net 2003 with Sqlserver 2000 server program , the same program is working...
6
by: Steve | last post by:
Hi All I have a windows forms Application (SAM) in vb.net 2008 using .net framework V2 One and only one customer out of 30 customers is getting errors daily where they have to close and...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.