Error in Visual Studio 2022 -- ASP.NET Framework 4.8 XSD Code Generation

Peter Held 0 Reputation points
2025-01-28T20:31:11.98+00:00

An ASP.NET Framework 4.8 VB Web Forms Site is generating the following error:

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

This error occurs after creating the .XSD file in the designer and adding a DataTable with a simple stored procedure.

In contrast, an ASP.NET Framework 4.8 VB Web Forms Application does not show this error when performing the same operation.

To reproduce the issue, the following environment is used:

  • Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.12.4
  • ASP.NET Framework 4.8
  • Telerik VB Web Forms Site

Attached is the documentation and screenshots detailing how to recreate the issue.

VisualStudio22_WebSite_DataSet_Issues_20250128.pdf

TIA for your assistance.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,588 questions
{count} votes

3 answers

Sort by: Most helpful
  1. XuDong Peng-MSFT 11,181 Reputation points Microsoft Vendor
    2025-01-29T03:46:18.8433333+00:00

    Hi @Peter Held,> This error occurs after creating the .XSD file in the designer and adding a DataTable with a simple stored procedure.

    Please check the ConnectionStringObject attribute in your .XSD file?

    If possible, you can try to change the ConnectionStringObject attribute on the Connection node inside your .XSD file. And set it value to valid connection string pointing to the database your dataset corresponds to.

    Something like this:

    <Connection ConnectionStringObject="Data Source=ServerName;Initial Catalog=DataSetName;Integrated Security=True" Name="constrName" Provider="System.Data.SqlClient" />
    

    Your environment may be different, please add or remove these attributes according to your needs.

    Best regards,

    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. SurferOnWww 3,816 Reputation points
    2025-01-31T03:55:16.34+00:00

    Telerik VB Web Forms Site

    Are you sure that the Telerik does not give influence on the issue?

    I could not reproduce your issue in my environment which uses the standard Web Site Project template of ASP.NET Web Forms (see below) available in the Visual Studio 2022 v17.12.4.

    enter image description here

    I have created the stored procedure in the AdventureWorks as shown blow:

    enter image description here

    I have created new Web Site Project using the template shown above and added .xsd file (i.e., strongly-typed DataDet/DataTable and TableAdapter) according to the procedures in your pdf file.

    enter image description here

    The result of rebuild was successful as shown below:

    enter image description here

    The data form the database AdventureWoks are obtained using the created strongly-typed DataDet/DataTable and TableAdapter as shown below:

    enter image description here

    I suspect that the Telerik gives influence on the issue.

    0 comments No comments

  3. SurferOnWww 3,816 Reputation points
    2025-01-31T03:55:51.27+00:00

    This answer has been deleted because of duplication.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.