|
-
May 18th, 2006, 02:53 AM
#1
Thread Starter
Fanatic Member
[RESOLVED][2.0] Problem passing List<T>
HI all I have a Method that I wish to pass a generic List as a parameter,
Code:
public void Test (List<Client> temp)
{
this.ClaimBindingSource.DataSource = temp;
}
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.Collections.Generic.List<Indemnity_System.Client>)'
If I use an ArrayList I do not get this problem any help would be great.
Last edited by Bombdrop; May 18th, 2006 at 04:51 AM.
Useful Links
.Net
#Develop, GhostDoc, CodeKeep , be.PINVOKE, Good Code Snippet Site
Krypton Toolkit, XPCC / XP Common Controls, QSS Windows Forms Components
VB.COM
VB.Classic Help File, MB Controls, MZTools, ADO Stored Procedure Generator add-in,
-
May 18th, 2006, 02:59 AM
#2
Re: [2.0] Problem passing List<T>
-
May 18th, 2006, 03:06 AM
#3
Thread Starter
Fanatic Member
Re: [2.0] Problem passing List<T>
Yes Client is a public class.
Useful Links
.Net
#Develop, GhostDoc, CodeKeep , be.PINVOKE, Good Code Snippet Site
Krypton Toolkit, XPCC / XP Common Controls, QSS Windows Forms Components
VB.COM
VB.Classic Help File, MB Controls, MZTools, ADO Stored Procedure Generator add-in,
-
May 18th, 2006, 03:10 AM
#4
Re: [2.0] Problem passing List<T>
How is the Client class or structure declared? I'm guessing that it has lower accessibility than public, right? If so then that's your problem: you're exposing a type that is not public through a method that is. The ArrayList doesn't give you the issue because ti has no specific connection to the Client type.
And after typing that I decidied to read dee-u's post and I see that I'm a bit late with the advice.
-
May 18th, 2006, 03:17 AM
#5
Re: [2.0] Problem passing List<T>
 Originally Posted by Bombdrop
Yes Client is a public class.
Or maybe I spoke too soon. Are you absolutely sure that it's public because that's the exact error message I get if I declare an internal Client class and then use the exact method declaration that you did?
-
May 18th, 2006, 03:23 AM
#6
Thread Starter
Fanatic Member
Re: [2.0] Problem passing List<T>
SOrry guys it's always the stupid things that trip you up I had not declared my class as public Sorry but thanks for the helps
Useful Links
.Net
#Develop, GhostDoc, CodeKeep , be.PINVOKE, Good Code Snippet Site
Krypton Toolkit, XPCC / XP Common Controls, QSS Windows Forms Components
VB.COM
VB.Classic Help File, MB Controls, MZTools, ADO Stored Procedure Generator add-in,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|