Question

Here's my problem : Visual studio crashed while I was writing some code. After restarting, I got an error message "failed to load dataset because of the following error : column requires a valid datatype". I'm using 2 typed dataset and none of them want to open in the designer. I tried Restarting VS, rebooting computer, loading an old and working version of the project, open the project on another computer (using Team Foundation), deleting sources files and replace them with ones from an old and working version. Nothing worked.

Any help would be greatly appreciated.

Was it helpful?

Solution

I solved this issue a while ago but I didn't find any solution online so here's my solution if someone ever needs it :

The issue come from the custom data type I use in one of the datatable. After the crash Visual studios was unable to recognize this type I created. This caused the Dataset to fail when loading (because of the unknown datatype) thus preventing me to rebuild the whole solution. Being unable to rebuild the solution prevented to compile my custom datatype and so on.

In order to solve this loop of fails, you can either :

  • Clean the solution then build the project where the custom type is contained first. Then rebuild the whole solution.
  • If the first method doesn't work, you can open the xml file of the dataset (right click on the file in the solution explorer > open with xml). Find the definition of the datatable containing the custom type and change the type of the column with something known (like String, int, pick the most appropriate). Save and reopen the dataset with designer (which should load now). You can now rebuild your whole project, go back in the designer, reassign the custom type to the column (the XML file will be re-generated) and you're done.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top