Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datasets and namepaces
Message
From
02/07/2011 13:32:39
 
 
To
02/07/2011 11:39:24
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01517067
Message ID:
01517153
Views:
29
Say: Common assemly:
using System.Data;
namespace Common
{
    public class SomeStronglyTypedDataSet : DataSet
    {
    }
}
Assembly B:
namespace ProjectB
{
    public class SomeClass
    {
        public void DoSomethingWithDS(Common.SomeStronglyTypedDataSet ds)
        {
        }
    }
}
Then in ProjectA:
namespace ProjectA
{
    public class SomeClass
    {
        public void SomeMethod()
        {
        Common.SomeStronglyTypedDataSet ds = new Common.SomeStronglyTypedDataSet();
        ProjectB.SomeClass  sc = new ProjectB.SomeClass();
        sc.DoSomethingWithDS(ds);
        }
    }
}
Both A and B need a reference to Common. A also needs a reference to B.


>Hmm
>I like that
>If i put the class in an assembly, will I be able to pass a stronglyped dataset from the project's namespace as an argument to a method in the assembly?
>What type will the parameter in the method in the assembly have?
>
>
>
>
>>>Why did you need to have the class in both ProjectA and ProjectB ?
>In any case it would probably be better to put such a class in a separate 'Common' assembly and reference that assembly from all three of the existing projects.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform