Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2007

Tip: Looking for answers? Try searching our database.

Is this CLS compliant?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew - 16 Apr 2007 23:38 GMT
Hello, friends,

I defined a C# class like the follows in .net 2.0:

   [Serializable]
   public class ContractInfo
   {
       private string number;
       private string transCode;
       private int? vcCode;
       private DateTime? termFrom;
       private DateTime? termTo;
       private decimal? revMax;
       private DataTable dtAttribute;

       public ContractInfo()
       {
       }

       public string Number {set {this.number = value;}get {return
this.number;}}
       public string TransCode {set {this.transCode = value;}get {return
this.transCode;}}
       public int? VCCode {set {this.vcCode = value;}get {return
this.vcCode;}}
       public DateTime? TermFrom {set {this.termFrom = value;}get {return
this.termFrom;}}        
       public DateTime? TermTo {set {this.termTo = value;}get {return
this.termTo;}}
       public decimal? RevMax {set {this.revMax = value;}get {return
this.revMax;}}
       public DataTable DTAttribute { set { this.dtAttribute =
value.Copy(); } get { return this.dtAttribute; } }
   }

and I called a Window Form function, in which a ContractInfo data type
parameter was passed as the follows:

    public void PopulateContractInfo(ContractInfo contractInfo)
    {
        ..........
    }

When our build machine compiled, it complained, saying: Argument type
'Contract.ContractInfo' is not CLS-compliant. (CS3001)

I checked our code, I saw that we did have [assembly: CLSCompliant(true)] in
AssemblyInfo.cs.

So, I was confused.

Any ideas, reference papers? How to fix it? Thanks a lot.
RobinS - 17 Apr 2007 04:08 GMT
I suspect it's the DataTable that's getting you. Try taking it out and see
if it compiles.

Robin S.
------------------------------------------
> Hello, friends,
>
[quoted text clipped - 49 lines]
>
> Any ideas, reference papers? How to fix it? Thanks a lot.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.