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

c#, DataSet and CLS Compliance

The question is, is a DataSet CLS compliant?

Minimally implemented code, with an attribute [assembly:
CLSCompliantAttribute(true)] in the assemblyinfo.cs compiles just fine (is
it possibly the data INSIDE the dataset that could invalidate its
compliancy?):

using System;
using System.Data;

namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Class2 class2 = new Class2();
DataSet newDs = class2.getDataSet();
}
}
}

using System;
using System.Data;

namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class2.
/// </summary>
public class Class2
{
public Class2()
{
//
// TODO: Add constructor logic here
//
}

public DataSet getDataSet()
{
DataSet newDS = new DataSet("newDatSet");
return newDS;
}
}
}

However, earlier today I was thinking:

Evidence seems to indicate that they Datasets are not CLS compliant.
In Googling, I found a few comments like:
I'm a little concerned about passing datasets on a public interface.
Until someone can let me know that cross-platform development won't be
hindered by using a dataset on a public interface (Dataset is not CLS
Compliant) I'm going to try and not use them in classes that I would
consider libraries for my own code re-use. I wish someone from Microsoft
would way in on that little issue. Paul


Eventually, I wound my way to the ECMA site
(http://www.ecma-international.org/)

List: http://www.ecma-international.org/pu...s/Standard.htm
C# Standard:
http://www.ecma-international.org/pu...s/Ecma-334.htm (CLS)

From Appendix D Standard Library I culled the following namespaces:
// Namespace: System, Library: BCL
// Namespace: System, Library: ExtendedNumerics
// Namespace: System.Collections, Library: BCL
// Namespace: System.Diagnostics, Library: BCL
// Namespace: System.Globalization, Library: BCL
// Namespace: System.Security, Library: BCL
// Namespace: System.Security.Permissions, Library: BCL
// Namespace: System.Text, Library: BCL
// Namespace: System.Threading, Library: BCL

(Note there is no System.Data namespace)

My speculation trail is rather short. If the intent of CLS is to promote
cross-platform development and cross language development then how do you
tell java or small talk or any non-ms type language what a DataSet is?

This is not to say that a DataSet cannot be used privately, it's just that a
DataSet type cannot be exposed in any public member.

FWI, this is an inferred conclusion. I have not seen anything concrete that
says yea or nay.
Thoughts appreciated. Thanks!

Rob
Nov 15 '05 #1
3 2935
"news.microsoft.com" <rw****@waggs.net> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
The question is, is a DataSet CLS compliant?
Yes. CLI inclusion is a separate issue from CLS compliance.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com


Minimally implemented code, with an attribute [assembly:
CLSCompliantAttribute(true)] in the assemblyinfo.cs compiles just fine (is
it possibly the data INSIDE the dataset that could invalidate its
compliancy?):

using System;
using System.Data;

namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Class2 class2 = new Class2();
DataSet newDs = class2.getDataSet();
}
}
}

using System;
using System.Data;

namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class2.
/// </summary>
public class Class2
{
public Class2()
{
//
// TODO: Add constructor logic here
//
}

public DataSet getDataSet()
{
DataSet newDS = new DataSet("newDatSet");
return newDS;
}
}
}

However, earlier today I was thinking:

Evidence seems to indicate that they Datasets are not CLS compliant.
In Googling, I found a few comments like:
I'm a little concerned about passing datasets on a public interface.
Until someone can let me know that cross-platform development won't be
hindered by using a dataset on a public interface (Dataset is not CLS
Compliant) I'm going to try and not use them in classes that I would
consider libraries for my own code re-use. I wish someone from Microsoft
would way in on that little issue.Paul

Eventually, I wound my way to the ECMA site
(http://www.ecma-international.org/)

List:

http://www.ecma-international.org/pu...s/Standard.htm C# Standard:
http://www.ecma-international.org/pu...s/Ecma-334.htm (CLS)
From Appendix D Standard Library I culled the following namespaces:
// Namespace: System, Library: BCL
// Namespace: System, Library: ExtendedNumerics
// Namespace: System.Collections, Library: BCL
// Namespace: System.Diagnostics, Library: BCL
// Namespace: System.Globalization, Library: BCL
// Namespace: System.Security, Library: BCL
// Namespace: System.Security.Permissions, Library: BCL
// Namespace: System.Text, Library: BCL
// Namespace: System.Threading, Library: BCL

(Note there is no System.Data namespace)

My speculation trail is rather short. If the intent of CLS is to promote
cross-platform development and cross language development then how do you
tell java or small talk or any non-ms type language what a DataSet is?

This is not to say that a DataSet cannot be used privately, it's just that a DataSet type cannot be exposed in any public member.

FWI, this is an inferred conclusion. I have not seen anything concrete that says yea or nay.
Thoughts appreciated. Thanks!

Rob

Nov 15 '05 #2
> Yes. CLI inclusion is a separate issue from CLS compliance.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com


I'm sorry, I'm not sure what that means. Would you be kind enough to expound
just a bit more?

Thanks.
Rob
Nov 15 '05 #3
"Rob Waggoner" <rw****@waggs.net@bogus> wrote in message
news:Os**************@TK2MSFTNGP10.phx.gbl...
I'm sorry, I'm not sure what that means. Would you be kind enough to expound just a bit more?


The Common Language Interface is specification.
The Common Language Runtime is an implementation of the CLI spec, as is the
work done by the SSCLI team at Microsoft, and the Mono team over in
open-source land.

The CLI covers the minimum behavior and class libraries that are required
for a .NET platform to be conforming - so you can depend on specific
behavior for core APIs and classes. However, some of the CLR (as well as
some of the SSCLI and Mono implementations) is not covered by the CLI, so
code that uses Windows Forms, or ADO.NET might not run on a cross-platform
implementation of the CLI.

These issues are separate from Commmon Language Specification (CLS)
compliance. CLS is used to ensure that C#, Visual Basic .NET, Eiffel, and
other .NET languages can have a consistent way of using types and
components. It describes how constructors are called, how types are named,
specifies types that must not be exposed outside an assembly, etc. For
example, unsigned scalars are non-compliant other than System.UInt16 (byte).

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com

Nov 15 '05 #4

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

Similar topics

119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
100
by: Roose | last post by:
Just to make a tangential point here, in case anyone new to C doesn't understand what all these flame wars are about. Shorthand title: "My boss would fire me if I wrote 100% ANSI C code" We...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
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...

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.