This is an archived thread from the StopByte developer forum —
browse all archived threads.
StopByte is now a payments & ecommerce toolkit — check out our
free calculators.
Parser Error Message: Failed to generate code. Exception of type ‘System.Data.Design.InternalException’ was thrown.
at this Line 1:
<?xml version="1.0" encoding="utf-8"?>
I get that error after creating a DataAdapter and add it to the XSD file.
thanks for advice!
2 Likes
sam
(SAM)
#2
The Issue:
I had similar exception many times, that exception occurs usually when you create your dataset using the Drag & Drop functionality in Visual Studio, either dragging your Dataset from the server explorer panel or from a database within your project. and then once you Remove, Rename that referenced Database (or is not accessible anymore for any reason) that exception will occur:
Parser Error Message: Failed to generate code. Exception of type ‘System.Data.Design.InternalException’ was thrown.
it can be for other reasons but as said that’s the common case for me.
How to Solve It:
Now to solve the issue is all you need to do is this:
Right click your Dataset in the project explorer, choose “Run Custom Tool” and select the Text Editor.
Once opened your dataset in a text editor, go through it until you find a “Connection” node.
the “connection” node has a “ConnectionStringObject” attribute that points to the old Database connection string.
Change that connection string to the appropriate one that works.