473,480 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem passing List<T>

HI all I have a Method that I wish to pass a generic List as a
parameter,

Expand|Select|Wrap|Line Numbers
  1. public void Test (List<Client> temp)
  2. {
  3. this.ClaimBindingSource.DataSource = temp;
  4. }
  5.  
The idea is then to bind it for a data report.

But upon trying to compile i get the following error

Error 1 Inconsistent accessibility: parameter type
'System.Collections.Generic.List<Indemnity_System. Client>' is less
accessible than method
'Indemnity_System.ReportView.Test(System.Collectio ns.Generic.List<Indemnity_System.Client>)'
If I use an ArrayList I do not get this problem any help would be great.

May 18 '06 #1
1 5392
Presumably, then, Indemnity_System.Client is scoped as internal.
ArrayList doesn't fail because the type is not exposed in the interface.
Either make Indemnity_System.Client public, or make the method internal
(since you won't be able to use it externally if the type
Indemnity_System.Client isn't public).

If you don't want to make the /class/ public, declare an interface with what
you need, and make the /interface/ public; then change the signature to
"public void Test (List<T> temp) where T : IClient" - this will allow any
list of items that support IClient

Marc
May 18 '06 #2

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

Similar topics

8
4948
by: Vivek | last post by:
Hi, I wish to update the LIST<T> created in PARENT FORM from the CHILD FORM. Currently I have declared the LIST<Role> as public in my parent form. What can I do to update the <LIST>? Thanks
2
3922
by: jamie | last post by:
hi, I'm trying to pass a List<double> array from C# to a C++ class library but I get the following error: "No overload for method 'zzz' takes '1' arguments" My C++ method in the library has 1...
4
33107
by: Sin Jeong-hun | last post by:
List<List<T>a=param; List<List<T>b=a; If I change b, then a is get changed. I want another copy of a, that is completely independent of a. I used double-nested for loop to copy each element...
6
46152
by: buzzweetman | last post by:
Many times I have a Dictionary<string, SomeTypeand need to get the list of keys out of it as a List<string>, to pass to a another method that expects a List<string>. I often do the following: ...
2
2223
by: per9000 | last post by:
Hi, *background* I want a class containing an int (a list of sets of integer). This should be hidden for the user and he/she should be able to insert his/her favourite data structure so to be a...
0
3157
by: Gerrit | last post by:
Hello, On http://msdn2.microsoft.com/en-us/library/ms184414.aspx is an example of the implementation of INotifyPropertyChanged Interface. I work with the C# example. I have tried this sample,...
2
5849
by: Assimalyst | last post by:
Hi I have a Dictionary<string, List<string>>, which i have successfully filled. My problem is I need to create a filter expression using all possible permutations of its contents. i.e. the...
0
278
by: Weeble | last post by:
On Jun 20, 11:10 pm, Göran Andersson <gu...@guffa.comwrote: I did it that way because CopyTo has a whole bunch of failure cases to take care of (multi-dimensional array, not enough space,...
1
8858
by: shapper | last post by:
Hello, On my MVC projects I often create classes which contains properties which are lists of other classes. Should I start using IQueryable<Tor IEnumerable<Tinstead of List<T>? What are...
0
6918
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...
0
7102
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...
1
6756
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
7003
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...
0
5357
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,...
1
4798
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...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
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...

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.