Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:19:26+00:00 2026-05-26T23:19:26+00:00

related Design Strongly typed object from XML Currently we run stored procedures based on

  • 0

related

Design Strongly typed object from XML

Currently we run stored procedures based on “SQL XML” where in we send xml string as input to stored procedures and get the response from stored procedures as xml. For a simple demonstration of user logging into application here is how it is done

<Request Type="" CRUD="C/R/U/D">`
<Users>
<UserName></UserName>
<Password></Password>
</Users>
</Request>

don’t mind about the response from database because that we can change to anything we desired to. It is this construction of xml that we find too intimidating. Below is code we follow

StringBuilder _sbXml = new StringBuilder();
_sbXml.AppendLine("<Request Type='' CRUD=''>");
_sbXml.AppendLine("<Users>");
_sbXml.AppendLine("<UserName>"+ usernameVariable +"</UserName>");
_sbXml.AppendLine("<Password>"+ passwordVariable +"</Password>");
_sbXml.AppendLine("</Users>");
DataTier.BeginRequest(_sbXml.ToString());

we tried abstracting things into methods but again we never solved the problem that we wanted to, just hid them somewhere.

So we concluded that strong typing is necessary for each request to
avoid any typo’s,undesired behavior, avoid hand coded xml and
maintainable

. Hence the question

  • How can i abstract away this form of building xml’s

  • XSD tool can generate class modelling xml data(Related post), is the class that is generated using the tool adaptive for long run?

  • Abstracting string xml to Typed classes is advisable? Has anyone had success doing something that i am trying to do now?Which did you feel comfortable with?

More

Above is just a single database call, we got same for all the database calls. We are into big mess maintaining for sure.

Extra

  1. Using C# 2.0

  2. .NET 2.0

  3. SQL Server 2005

  4. Visual Studio 2005

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:19:26+00:00Added an answer on May 26, 2026 at 11:19 pm

    There are two problems here:

    • You’re passing parameters to the stored procedures using XML, when stored procedures can take parameters in a perfectly normal way without using an intermediate layer
    • You’re building your XML by hand. Please don’t do that – .NET has plenty of good XML APIs, even though using .NET 2.0 means you can’t use LINQ to XML.

    So, I would suggest:

    • Get rid of the XML layer if you possibly can. I realize this may not be feasible.
    • Build the XML using APIs such as XmlDocument etc
    • You don’t want the XML-building code littering your code, certainly – whether you need several different types for this is unclear from your post; it will depend on how much your requests vary.

    (It’s not really clear what you meant by “we concluded that a class would solve things” or “I saw the related post and generated class” so it’s possible that I’m missing the point. If so, please edit your question to clarify.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is related to the design-time support of WPF. From MSDN I read,
Design patterns are usually related to object oriented design. Are there design patterns for
This question is related to this post: SQL design for survey with answers of
This is more like a design question but related to SQL optimization as well.
I have a design and object structuring related question. Here is the problem statement:
Related to: Query Windows Search from Java But this time to use OSX's spotlight
I have created a strongly typed dataset in the VS 2005 Dataset Designer. There
Grid related UI design question I want some 16-grid (4 rows and 4 columns)
When companies ask you to do OO design related questions in the interview, what
I 've a question related to design of file systems. These days we are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.