473,739 Members | 5,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error while creating a method that returns an Array

Hi,
Get the following error when trying to create a method that returns a
one-dimentional array.

You must implement a default accessor on System.Array because it
inherits from ICollection.

Below is how I am writing the method.

public Array Diagnosis(DataS et assessmentData)
{

//Do some logic work with assessmentData DataSet

//An array of SNOMED CT coded possible diagnosis results
int[] diagnosis = { 74400008, 162031009, 7093002, 76581006,
75694006};

return diagnosis;
}

New to both Arrays and Csharp so any help will be greatly appreciated.
I thought it was a namespace problem but I have "using System;"
namespace added.
Thank you kindly

Khurram

Jul 22 '06 #1
2 1810
public int [] Diagnosis(DataS et assessmentData) {}

should fix it for you

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

"Khurram" <kn*****@gmail. comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Hi,
Get the following error when trying to create a method that returns a
one-dimentional array.

You must implement a default accessor on System.Array because it
inherits from ICollection.

Below is how I am writing the method.

public Array Diagnosis(DataS et assessmentData)
{

//Do some logic work with assessmentData DataSet

//An array of SNOMED CT coded possible diagnosis results
int[] diagnosis = { 74400008, 162031009, 7093002, 76581006,
75694006};

return diagnosis;
}

New to both Arrays and Csharp so any help will be greatly appreciated.
I thought it was a namespace problem but I have "using System;"
namespace added.
Thank you kindly

Khurram

Jul 22 '06 #2
Thank you greg, worked like a charm

Khurram

Greg Young wrote:
public int [] Diagnosis(DataS et assessmentData) {}

should fix it for you

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

"Khurram" <kn*****@gmail. comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Hi,
Get the following error when trying to create a method that returns a
one-dimentional array.

You must implement a default accessor on System.Array because it
inherits from ICollection.

Below is how I am writing the method.

public Array Diagnosis(DataS et assessmentData)
{

//Do some logic work with assessmentData DataSet

//An array of SNOMED CT coded possible diagnosis results
int[] diagnosis = { 74400008, 162031009, 7093002, 76581006,
75694006};

return diagnosis;
}

New to both Arrays and Csharp so any help will be greatly appreciated.
I thought it was a namespace problem but I have "using System;"
namespace added.
Thank you kindly

Khurram
Jul 23 '06 #3

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

Similar topics

5
7957
by: Jeffrey Silverman | last post by:
Hi, all. I have a linked list. I need an algorithm to create a tree structure from that list. Basically, I want to turn this: $list = array( array( 'id' => 'A', 'parent_id' => null, 'value' => 'aaa') , array( 'id' => 'B', 'parent_id' => 'A', 'value' => 'bbb') , array( 'id' => 'C', 'parent_id' => 'B', 'value' => 'ccc') , array( 'id' => 'D', 'parent_id' => 'A', 'value' => 'ddd')
4
2328
by: ron | last post by:
Hi, I have class object that i serialize using the System.Xml.Serialization class. Intermittently the object is not getting serialized correctly, using System.Xml.Serialization classes. Therefore the application errors out when deserializing the xml data. It places the some part of the child element
7
4745
by: John Grandy | last post by:
My ASP.NET Web Service project has a Web Method that returns an array filled with instances of a custom class. The custom class is defined in a Class Library that is included in the web-service project. The same class lib is included in the ASP.NET Web Application that calls the web-method I can successfully call the web-method with
8
2828
by: ctiggerf | last post by:
I was hopeing someone could help me out here. Been stumped on this one all day. This function 1. Checks uploaded files. 2. Creates two resized images from each (a full size, and a thumbnail). 3. Returns an array with a bool (false if the upload failed), and an error message.
0
9802
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
3
6097
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object of type System.Object to an object of type PersonWS.WorkGroupData.". I've included the wsdl of the consumed axis web service, the request/responses of the web service by the .net app and the exception and stack trace. Hoping someone can tell me...
0
3485
by: shahiz | last post by:
This the error i get when i try to run my program Error: Unable to realize com.sun.media.amovie.AMController@18b81e3 Basically i have a mediapanel class that initialize and play the media as datasource import java.awt.BorderLayout; import java.awt.Component; import java.io.*; import java.net.URL; import javax.media.*;
4
3873
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I am using a master page senerio. The erro I'm getting is 'busyBox' is not a member of 'ASP.login2_aspx'
2
1994
Dormilich
by: Dormilich | last post by:
Hi, I'm testing my classes for a web page and I stumble upon an error I don't have a clue what it means: Error: Fatal error: Can't use method return value in write context in "output.php" on line 142 (line 12 in snippet) the error is caused by this call: empty($inSeite_inp->getValue('PAR_NAME')) method definition see second snippet, lines 142 to 166
0
8792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8215
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6754
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.