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

out parameter problem

Hi,

In my web service method (written in C#), I have a method like public string
myMethod(out int[] test1, string test1)

but when I use a web client to access this method, I got a run time
exception: System.NullReferenceException: object reference not set to an
instatnce to an object. What could be the problem and how to fix it? Thank
you very much.

-May
Nov 16 '05 #1
1 1789
Basically what the exception is telling you is that you're trying to
reference a method/property or do something else with a null-referenced
object. For example if you pass in null to the parameter test1 of
myMethod() and in the method try to do test1.ToString() you'll get the
NullReferenceException.

Look over the code and make sure you're not trying to do something similar
to the above. It's most likely not anything related to the out parameter.
You'd get a compile error (if i remember correctly) as opposed to an
exception if you don't properly set the out parameter.

"mei xiao" <mx***@peerdirect.com> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
Hi,

In my web service method (written in C#), I have a method like public string myMethod(out int[] test1, string test1)

but when I use a web client to access this method, I got a run time
exception: System.NullReferenceException: object reference not set to an
instatnce to an object. What could be the problem and how to fix it? Thank
you very much.

-May

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
4
by: wkaras | last post by:
I would like to propose the following changes to the C++ Standard, the goal of which are to provide an improved ability to specify the constraints on type parameters to templates. Let me say from...
2
by: Siegfried Weiss | last post by:
Hi guys, i give up finding a solution by reading or by trial & error. Hope, YOU can help me! (Sorry for my rather long posting.) Stroustrup says, that templates could be declared with - type...
8
by: Dave Veeneman | last post by:
Can I pass a method pass one of its out parameters to another method? C# is telling me I can't. Let's say I have two methods, FooManager and FooWorker. FooManager is part of a class that acts as...
0
by: Billie Boy | last post by:
Hi to all. I’m new here and am coming to you from Melbourne Australia. So a big HELLO 2 ALL. Now I am encountering an annoying problem in the SQL builder of the copy of VB.6 that I am using at...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
4
by: =?Utf-8?B?QmlsbEF0V29yaw==?= | last post by:
Hi, We recently converted a 1.1 project to 2.0 and this included a webservice which accepted XML for one of the parameters. Since converting to 2.0 I am getting the following message: --- A...
5
by: Trevisc | last post by:
Happy Thursday Everyone, I am trying to create a parameter that is one long varchar but that will be used in a SQL statement IN function: //string queryString = GetCurrentTitles(); //Below is...
8
by: DanicaDear | last post by:
I have something interesting...looking to see if anyone else has came across this. I have a query with parameter and and the query works beautifully every time. However, when I use the wizard...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.