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

  • SEARCH
  • Home
  • 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 8290561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:50:49+00:00 2026-06-08T12:50:49+00:00

I currently have this method in a standard web service: [WebMethod] public void addGame(int

  • 0

I currently have this method in a standard web service:

[WebMethod]
        public void addGame(int GamePlayID, int @ParticipantID, int @GameVersionID, string Start, string End,string success)
        {
            SqlConnection oConn = new SqlConnection();
            oConn.ConnectionString = @"Data Source=SNICKERS\SQLEXPRESS;Initial Catalog=VerveDatabase;Integrated Security=True";
            oConn.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = oConn;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "addGamePlay";
            cmd.Parameters.Add(new SqlParameter("@GamePlayID", SqlDbType.Int));
            cmd.Parameters["@GamePlayID"].Value = GamePlayID;
            cmd.Parameters.Add(new SqlParameter("@ParticipantID", SqlDbType.Int));
            cmd.Parameters["@ParticipantID"].Value = @ParticipantID;
            cmd.Parameters.Add(new SqlParameter("@GameVersionID", SqlDbType.Int));
            cmd.Parameters["@GameVersionID"].Value = @GameVersionID;
            cmd.Parameters.Add(new SqlParameter("@Start", SqlDbType.Time));
            cmd.Parameters["@Start"].Value = Start;
            cmd.Parameters.Add(new SqlParameter("@End", SqlDbType.Time));
            cmd.Parameters["@End"].Value = End;
            cmd.Parameters.Add(new SqlParameter("@success", SqlDbType.VarChar, 10));
            cmd.Parameters["@success"].Value = success;
            cmd.ExecuteNonQuery();
        }

This allows me to pass values accross to the database which are entered manually.However I want to be able to load the data from an XML document. How do I get data from this XML document to fill the variables in this method. Here is the XML document:

<?xml version="1.0" encoding="UTF-8"?>
<anyType xmlns="http://tempuri.org/" xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance" d1p1:type="q1:string" xmlns:q1="http://www.w3.org/2001/XMLSchema">
<NewDataSet>
<Game> 
<GamePlayID>1</GamePlayID>
            <ParticipantID>1</ParticipantID> 
<GameVersionID>1</GameVersionID> 
<Start-Time>PT0S</Start-Time> 
<End-Time>PT5H</End-Time> 
<Success>true </Success> 
</Game>
</NewDataSet>
</anyType>
  • 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-06-08T12:50:50+00:00Added an answer on June 8, 2026 at 12:50 pm

    I don’t quite understand why I got down voted as this was a genuine question however I thought I would outline how I managed to over come the problem. As my paticular XML document only contains one node I used the “selectSingleNode” function on xmlDocument to pick the data I wanted and assigned them to variables ready to insert into my database via SQL proc.

    [WebMethod]
            public void addGame()
            {
                XmlDocument xd = new XmlDocument();
                xd.Load(@"C:\Users\bradleya\Documents\Visual Studio 2010\Projects\Web Services\Web Services\addGame.xml");
                XmlNode documentNode = xd.SelectSingleNode("/NewDataSet/Game");
    
                int GamePlayID = Convert.ToInt32(documentNode.SelectSingleNode("GamePlayID").InnerText);
                int ParticipantID = Convert.ToInt32(documentNode.SelectSingleNode("ParticipantID").InnerText);
                int GameVersionID = Convert.ToInt32(documentNode.SelectSingleNode("ParticipantID").InnerText);
                string Start = Convert.ToString(documentNode.SelectSingleNode("Start-Time").InnerText);
                string End = Convert.ToString(documentNode.SelectSingleNode("End-Time").InnerText);
                string success = Convert.ToString(documentNode.SelectSingleNode("Success").InnerText);
    
                SqlConnection oConn = new SqlConnection();
                oConn.ConnectionString = @"Data Source=SNICKERS\SQLEXPRESS;Initial Catalog=VerveDatabase;Integrated Security=True";
                oConn.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = oConn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "addGamePlay";
                cmd.Parameters.Add(new SqlParameter("@GamePlayID", SqlDbType.Int));
                cmd.Parameters["@GamePlayID"].Value = GamePlayID;
                cmd.Parameters.Add(new SqlParameter("@ParticipantID", SqlDbType.Int));
                cmd.Parameters["@ParticipantID"].Value = @ParticipantID;
                cmd.Parameters.Add(new SqlParameter("@GameVersionID", SqlDbType.Int));
                cmd.Parameters["@GameVersionID"].Value = @GameVersionID;
                cmd.Parameters.Add(new SqlParameter("@Start", SqlDbType.Time));
                cmd.Parameters["@Start"].Value = Start;
                cmd.Parameters.Add(new SqlParameter("@End", SqlDbType.Time));
                cmd.Parameters["@End"].Value = End;
                cmd.Parameters.Add(new SqlParameter("@success", SqlDbType.VarChar, 10));
                cmd.Parameters["@success"].Value = success;
                cmd.ExecuteNonQuery();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have this method: -(void)seperateGuides { DLog(GetGuideListCount: %i, [[appDelegate getGuideList] count]); columnOneArray =
I currently have this working but it requires me to have a static method
I have a pretty standard Spring 3.0.7 web app The structure is like this
Paramiko's SFTPClient apparently does not have an exists method. This is my current implementation:
I currently have this sql statement that I wrote and it works but it's
I currently have this and it works fine but I wanted to have a
I currently have this: function submit() { document.getElementById(lostpasswordform).click(); // Simulates button click document.lostpasswordform.submit(); //
I currently have this code which stores XML into an XML-type column called data,
I currently have this set up and working fine inside a users folder. RewriteEngine
I currently have this code: PACKETS = {}; function AddPacket(data) local id = data.ID;

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.