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

Index was outside the bounds of the array

I am having some trouble with an array object and a web service I have. I
have a farly simple user object

[Serializable()]
public class User
{
private Guid myUserId;
public Guid UserId
{
get { return myUserId; }
set
{
myUserId = value;
}
}

private string myLogin;
public string Login
{
get { return myLogin; }
set
{
myLogin = value;
}
}

.....
private UserContacts myContact = new UserContacts();
[XmlElement(typeof(UserContacts))]
public UserContacts Contact
{
get { return myContact; }
set { myContact = value; }
}

}

I am having difficulty with the Contact property, which is a GenericList of
UserContact objects. This class works fine when used directly but when called
through my web service I keep getting "Index was outside the bounds of the
array", no matter how I try to set the Contact variable from the WebService
client.

IE
--CLIENT SIDE
devl.services.UserContact[] ucs = new devl.services.UserContact[1];
devl.services.UserContact uc = new devl.services.UserContact();

uc.ContactType = "email";
uc.ContactValue = "so**@email.address.net";

testUser.Contact = new devl.services.UserContact[0];
testUser.Contact[0] = uc; //INDEX OUT OF BOUNDS

I must be missing something important, but I am at a loss for what it might
be :(.

Thanks,

Beaker
May 25 '06 #1
0 2319

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

Similar topics

1
by: kim | last post by:
Scenario (I'm a newbie): I have a datagrid with countries listed and 5 parameters in each row. I want to add a row to this datagrid via an Event Handler. Very basic stuff. This method then call a...
0
by: Eugene | last post by:
Hello all, I've been trying to figure this out for a few days now, and still have no clue what's going on... I have a few related tables in MS Access (Clients, Cars, Sales), and a datagrid,...
1
by: Joe | last post by:
This is a weird problem. when doing trying to add a tabpage to a tabcontrol I get an error: Index was outside the bounds of the array. Now this only happens when I call a function from within...
1
by: iCeCLoW | last post by:
Hi there, I´m using the rowFilter property for filtering the rows in a DataView object. If the filter is set to an inexistent value , that is, after filtering i have 0 rows in the DataView,...
0
by: scotthutchinson | last post by:
I have a .NET Remoting object hosted in IIS6 on Windows Server 2003 (happens before and after installing SP1) at an endpoint (ASP.NET application virtual folder) named "CompanyXYZReporting". The...
2
by: Denis C | last post by:
Hi there, I'm trying to convert part of a byte array into a series of fixed length strings but half way through the for loop I get an error that I'm accessing outside the buffer bounds. The...
4
by: Antoine | last post by:
Herfried and Cor:- I used tracing and actually tracked down the code that was causing the problem most likely. I wonder if you wanted to comment on it. Also I wonder if there is a better way...
3
by: Cammie Watson | last post by:
Hi there, We have a web application written in asp.net (1.1). I'm not going to go into too much detail but we use a DLL to communicate with the database and also a couple of webservices. When...
4
by: weird0 | last post by:
I have no idea why this error this is coming and how can i fix it? Can anyone please help me with it..............? public static class BillManager { private static Object ExecuteSP(Object...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.