Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datasets and namepaces
Message
From
02/07/2011 11:20:48
 
 
To
02/07/2011 08:54:07
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01517067
Message ID:
01517145
Views:
25
>Thanks for your answer, Viv.
>
>Project A has namespace and B has namespace B.
>Project C, which both call, has namespace C.
>That works well for a lot of other reasons.
>
>That setup works, as long as C never has to see the actual datasets that A and B are using and vice versa. That is usually the case, where C accepts or returns regular types.
>There is only instance where C needed to see that actual dataset, so I punted and removed that class from C and put a copy of it in both A and B.
>Duplicate code is a major no-no for me, but now and then it's the best answer.

Why did you need to have the class in both ProjectA and ProjectB ?
IAC 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.

>I'm still wondering, tho, if it's possible to get namespacea.datasetds information into namespaceb.datasetds without copying it table by table, row by row.

You can copy a DataSet simply be using the DataSet.Copy() method - but I'm guessing that you are referring to copying from one strongly type DataSet to another in which case the answer is No.


>>>If it worked when everything was in one project then it should still work if you use the same namespace for all three projects.
>
>If you do need different namespaces for each assembly then:
>Add a reference to ProjectA in ProjectC and, in Project C, refer to the ProjectA Dataset using it's fully qualified namespace.
>
>But, in either of the above cases, if you have a situation where currently two assemblies would need to reference *each other* then you have no real alternative but to factor out the classes that both assemblies share into a third assembly which they both can reference. Again there is no reason why classes in the new, third assembly should not retain the same namespaces.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform