Typed DataSet Generator And Namespaces


  • In VS 2005 I've used the Typed DataSet Generator tool to design a typed dataset.  Everything works fine as far that goes except for a small issue with namespaces.  The generator tool creates a hidden class file called <DataSetName>.Designer.vb that is not in a default namespace in VB.NET.  Due to our design policies for class libraries I cannot assign a default namespace to the assembly that the class is in at the project level. 

    All of the other classes in the same assembly have been manually assigned a namespace, including the partial class that is also created by the designer in which I've implemented some custom code to load data into a specific table within the type DataSet using the "initialized" event.  I'd like to put all of the classes that the designer generates into the same namespace, but when you do that with the <DataSetName>.Designer.vb class, the code is automatically overwritten each time you make a change to the schema in the designer. 

    Has anyone out there found a way to assign a namespace in the scenario?

    Thanks a lot,
    Thursday, November 29, 2007 1:50 PM


  • Hi,


    When you select the DataSet in the Solution Explorer and look at it's properties there is a Custom Tool Namespace option. Enter your namespace in there and your DataSet is placed in that namespace. Do not open the DataSet and look at the properties, where you have the XSD namespace. It's the properties when the DataSet is selected in the Solution Explorer it's in with the Build Action property.

    Thursday, November 29, 2007 5:25 PM