none
Visual Studio 2013 DataSet Designer won't load custom data types. RRS feed

  • Question

  • I want to use custom datatypes in my DataSet.  Specifically, I have a set of Enums that I want to use instead of integers.  When I start the DataSet Designer, it allows me to enter the fully qualified name of the datatype into a column.  Allows me to set up indices and relations.  Everything appears to work just fine.  However, exit the IDE and start it back up again and you get the message "Column requires a valid DataType".

       <xs:element name="DataColumn1" msdata:DataType="DataModel.MyEnum, DataModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" msprop:Generator_ColumnVarNameInTable="columnDataColumn1" msprop:Generator_ColumnPropNameInRow="DataColumn1" msprop:Generator_ColumnPropNameInTable="DataColumn1Column" msprop:Generator_UserColumnName="DataColumn1" type="xs:anyType" minOccurs="0" />

    • Moved by Amanda Zhu Monday, June 16, 2014 8:49 AM
    Sunday, June 15, 2014 12:51 AM

All replies

  • Hi,

    Because your issue is related to DataSet, I moved this thread to ADO.NET DataSet forum for better support.

    Thanks,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 16, 2014 8:50 AM
  • Charles, that is incorrect. The ADO.Net DataSet works just fine. It compiles and runs without any issues. This is a Visual Studio issue, not an issue with the ADO.NET libraries.
    Monday, June 16, 2014 10:48 AM
  • Hello DRAirey1,

    I reproduce this issue. After studying a while, I find that the designer saves such type references as assembly qualified name in the XSD, when we close the IDE, it seems to be clean the references so that it could load the specific type.

    The solution is that we need to open the XSD file with XML editor and save it, it will re-reference these types(as enum)and then dataset designer would load custom data types.

    You can have a try and if this does not work for you, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, June 17, 2014 3:38 AM
    Moderator
  • Fred, I'm having trouble following your instructions here.  The complete type information is saved in the column description in the XSD file already.  That should be all the information the designer needs to find the type and load it.  I created a diff of the XSD file before and after exiting the IDE and I can't find any differences (or any information that was 'cleaned').  Further, I work with the XML editor all the time and have never noticed any additional annotations that suggest loading instructions.

    Please provide more details.  I don't mind working with the XML editor so long as I can use the designer surface when I need to.



    • Edited by DRAirey1 Wednesday, June 18, 2014 5:14 PM
    Tuesday, June 17, 2014 10:44 AM
  • Hi,

    This is an issue with VS 2008 before:

    http://connect.microsoft.com/VisualStudio/feedback/details/307054/using-custom-types-enums-as-the-type-of-columns-in-typed-datasets

    I do not know whether the team has fixed it with VS2013. Do you have a try the way I described: open it with XML and press Crtl+S to save it and then open the designer? I also tested with VS2012 and got the same result, so I think when saving it, it have done something.

    If you have the same result, I will post a feedback to the team to let them know this scenario.

    Regards.

    Thursday, June 19, 2014 3:12 AM
    Moderator
  • Fred,

    1.) No, opening the XSD, saving and then loading the designer has no effect.

    2.) The problem is the same when the enums are defined in a separate project.  The problem you referenced in VS2008 doesn't appear to apply in this case.

    3.) This is clearly a bug.  The designer can reference and use the custom types just fine when you first construct the DataSet.  It is only after exiting and starting the project again in VS 2013 that it loses the ability to find the datatype again.

    Please escalate.


    • Edited by DRAirey1 Thursday, June 19, 2014 10:28 AM
    Thursday, June 19, 2014 10:26 AM
  • Hello,

    Done it:

    https://connect.microsoft.com/VisualStudio/feedback/details/901129/vision-studio-2013-dataset

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 20, 2014 8:52 AM
    Moderator