2 Replies - 14257 Views - Last Post: 26 February 2009 - 06:33 PM Rate Topic: -----

#1 newProgram  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 160
  • Joined: 28-October 08

Failed to generate code. Exception of type 'System.Data.Design.Int

Post icon  Posted 26 February 2009 - 02:52 AM

Hi to all,

I uploaded an application on my test machine and when I'm trying to access it I recieve an error saying:

"Failed to generate code. Exception of type 'System.Data.Design.InternalException' was thrown."

Line 1:  <?xml version="1.0" encoding="utf-8"?>
Line 2:  <xs:schema id="clinicListOfDoc" targetNamespace="http://tempuri.org/clinicListOfDoc.xsd" xmlns:mstns="http://tempuri.org/clinicListOfDoc.xsd" xmlns="http://tempuri.org/clinicListOfDoc.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
Line 3:	<xs:annotation>



My application is running smoothly on the machine that I use to develop the web application. What this error mean and what are the possible ways in solving this issue?

Thanks in advance.

Is This A Good Question/Topic? 0
  • +

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Failed to generate code. Exception of type 'System.Data.Design.Int

Posted 26 February 2009 - 09:42 AM

If you initially created the datasets by dragging and dropping from the Database or Server Explorer inside of Visual Studio, and the database reference at some point is no longer valid (moved/deleted the database), it will cause this exception.

It's due to the fact that Visual Studio stores the connection string within the XSD. If that connection string is no longer valid, it can't dynamically generate the needed adapters. To fix this, change the ConnectionStringObject attribute on the Connection node inside the XSD file (not at design level, but at the text editor level.) Set it to a valid connection string pointing to the database your dataset corresponds to, and you're good to go. Just right click on your dataset in the Solution Explorer, and click "Run Custom Tool", and your problem should be fixed.
Was This Post Helpful? 1

#6 newProgram  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 160
  • Joined: 28-October 08

Re: Failed to generate code. Exception of type 'System.Data.Design.Int

Posted 26 February 2009 - 06:33 PM

View PostPsychoCoder, on 26 Feb, 2009 - 08:42 AM, said:

If you initially created the datasets by dragging and dropping from the Database or Server Explorer inside of Visual Studio, and the database reference at some point is no longer valid (moved/deleted the database), it will cause this exception.

It's due to the fact that Visual Studio stores the connection string within the XSD. If that connection string is no longer valid, it can't dynamically generate the needed adapters. To fix this, change the ConnectionStringObject attribute on the Connection node inside the XSD file (not at design level, but at the text editor level.) Set it to a valid connection string pointing to the database your dataset corresponds to, and you're good to go. Just right click on your dataset in the Solution Explorer, and click "Run Custom Tool", and your problem should be fixed.

[quote]
Hi,

Thanks for the response. I tried to do what you have said but when I right click the dataset in the Solution Explorer there in no "Run Custom Tool". And the connection string of my datasets are on the Web.config. Also I open my XSD code and ConnectionStringObject has no value, what should I put there?

Thanks.
[/qupte]
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1