none
how to set the dataset's namespace

    Question

  • hi,

    I'm use the Dataset Desinger of Visual Studio 2005 to design a dataset.

    Then, I compile the project. The desinger generate a typed dataset class.

    But the dataset class is inside the global namespace. How to set to generate the typed dataset class in a customed namespace.

    The namespace above is C# namespace. Not the XML namespace.

    thanks.

    Monday, February 20, 2006 12:05 PM

Answers

  • I was able to set the dataset's namespace by selecting dataset in Solution Explorer and then setting the Custom Tool Namespace property.  This caused the generated dataset to use my custom namespace.
    Friday, February 24, 2006 5:15 AM
  • VS 2005 has the same "Custom Tool Namespace" property available on the DataSet.xsd object in the Solution Explorer.  If the "Properties" pane is not visible by default, Righ-click on the the DataSet.xsd object in the Solution Explorer and the "Custom Tool Namespace" property will be there.  I've tried this on VS 2005 Pro edition.
    Tuesday, March 14, 2006 9:51 PM

All replies

  • Hi,

    When you create a typed dataset, the generated dataset class inherits the DataSet Class object. That is why it is inside the global namespace. You cannot customize the namespace of the generated dataset class.

    Hth,

    Michael Castillones

    Wednesday, February 22, 2006 5:43 AM
  • Wednesday, February 22, 2006 10:42 AM
  • Hi,

    Hope you'll not be encountering any errors when you modify it.

     

    Thursday, February 23, 2006 3:25 PM
  • I was able to set the dataset's namespace by selecting dataset in Solution Explorer and then setting the Custom Tool Namespace property.  This caused the generated dataset to use my custom namespace.
    Friday, February 24, 2006 5:15 AM
  • Well how to do the same in VS 2005? I can't find Custom namespace property for the dataset in VS2005.
    Monday, March 13, 2006 6:52 AM
  • VS 2005 has the same "Custom Tool Namespace" property available on the DataSet.xsd object in the Solution Explorer.  If the "Properties" pane is not visible by default, Righ-click on the the DataSet.xsd object in the Solution Explorer and the "Custom Tool Namespace" property will be there.  I've tried this on VS 2005 Pro edition.
    Tuesday, March 14, 2006 9:51 PM
  • Sorry to say but I can't find Custom Tool Namespace. The property for the dataset only has targetNamespace which I think is not the namespace I required. Again I can't find the Custom Tool Namespace while right clicking the dataset file from solutin explorer. I am using VS 2005 Team Suite.

     

    Thursday, March 16, 2006 4:54 AM
  • I'm using VS.NET 2005 Visual Studio Team Edition for Software Developers.

    Ok, here is how I did it.

    Open VS.NET 2005.

    Menu -> File | New | Project

    Select C# Windows Application project, OK.

    Menu -> Data | Add New Datasource...

    Select Database... Next.

    Select my datasource, Next

    Select Authors table, Next.

    Select tdsDataSet.xsd in Solution Explorer tree view, right click and select Properties.  Under Advanced I see Custom Tool Namespace.

     

     

     

    Friday, March 17, 2006 5:05 AM
  • I know exactly what it should look like. But for me as well, I can't see "Custom Tool Namespace" in VS 2005.

    The only 2 properties I can see in the "Properties" windows is "File Name" and Full Path.

    The file I have selected in the Solution Explorer is "ReceiptDataSet.xsd".

     

    I''ve done this before but it was in VS 2003.

    Screenshot of VS 2005 with no "Custom Tool Namespace"-property.

    Friday, March 17, 2006 9:51 AM
  • You have to right-click on the .xsd in the Solution and choose Properties. Simply opening the PropertySheet while you have the .xsd open in the designer doesn't do it.

    If you still don't see it, do you see Custom Tool? You should see that and it should be set to MSDataSetGenerator.

    In any case, the default namespace of the generated code should be the namespace of the project it's in. This isn't what you want?

    Sunday, March 19, 2006 12:36 AM
  • This driving me really crazy. First I can't find properties on right clicking the xsd file. The only menu item shown on right clicking are
    1) Open
    2) Open With...
    3) View Code
    4) View Designer
    5) Exclude from project
    6) Cut
    7) Copy
    8) Delete
    9) Rename

    This applies not only to the xsd files but also cs files.
    And I can't even see Custom tool as you said.
    Is this all a version issue. As I have said before, I am using Team Suite.
    Monday, March 20, 2006 4:03 AM
  • Wow. Weird. I'm looking at Team Suite too, and I see Properties on the right-click menu (and a few others that you're not showing).

    Do you perhaps have a Beta version? Mine is not Beta, it's Version 8.0.50727.42 (RTM.050727-4200).

    Monday, March 20, 2006 5:35 AM
  • Wait! Hold the phone! I see a difference ... from looking at your screen shot I see that your .xsd is in a Web Service (mine wasn't) ... as soon as I put one in a Web Service project, I get the same right-click menu as you did.

    I don't know if this is a bug, or if it's by design, but cheer up ... you're not going crazy.

    Monday, March 20, 2006 5:45 AM
  • But wait ... there's more! It worked just fine in VS2003 under a Web Service project.

    So, looks like it's a bug in VS2005.

    Monday, March 20, 2006 5:53 AM
  • My VS 2005 version is not beta. It is Team Suite 8.0.50727.26.

    Again I am not using web sevice. Its simply a web application.

    Monday, March 20, 2006 7:10 AM
  • Yes. I got down to the bottom with it. The thing is that a web-project does not have a *.vbproj file. It is in the *.vbproj file the "Custom Tool Namespace" property is saved. I have tried to put my project in a Solution but I can never get an *.vbproj file for a webservice.

    Why dont the save a property that has with *.xsd to do in the *.xsd file. The only thing that property should do is when it generates the classes is to add for ex. "Namespace myNameSpace" and "End Namespace".

    Monday, March 20, 2006 8:59 AM
  • Hmmm ... you're right ... there's no proj file (there is in VS2003, but not VS2005). How do you add references then? I'm in the middle of figuring out the various stuff I need to do to port my app from VS2003 to VS2005. The test app I converted did not need any references in the Web Service (because the WS wasn't doing a whole lot ... it's just a test app), but my real app *does* need references to biz classes and dataset classes. I'm gonna have to see how this impacts it. It might be something simple I've overlooked.
    Monday, March 20, 2006 3:21 PM
  • Yeah, it was something simple ... in a Web Service or Web App, you just right-click on the bin folder to add your references.

    So, here's what you need to do: make a separate DataSet project in your solution. That project will then have all the stuff you need to generate the Typed DataSet from your .xsd, etc.

    Then, in the Web Service project, just add a reference to it.

    Monday, March 20, 2006 5:12 PM
  • Link is dead. Do you have another?

    -- Mark Kamoski

    Tuesday, February 18, 2014 3:10 PM