Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi all.

I need to get I have a url from outside that in need to post data to as xml.

this data comes from my sql server. I need to use C# for this functionality.

What I have tried:

Im currently writing this data to a file.

I need to do this per row from a database:

here is what I have so far.


connetionString = ConfigurationManager.ConnectionStrings["CompanyConnectionString"].ConnectionString;
           connection = new SqlConnection(connetionString);
           sql = "select * from Employee";
           try
           {
               connection.Open();
               adapter = new SqlDataAdapter(sql, connection);
               adapter.Fill(ds);
               connection.Close();
               //Label1.Text = (ds.WriteXml);

               ds.WriteXml("c:/temp/Product.xml");
               Response.Write("Done");
           }
           catch (Exception ex)
           {
               Response.Write(ex.ToString());

           }
Posted
Updated 8-Jun-17 7:35am
Comments
Maciej Los 26-May-17 10:48am    
Sorry, but your question is unclear. Can you provide more details?
Have you seen this: XML Web Services Basics[^]?
j snooze 26-May-17 17:40pm    
I'm not seeing an issue so far. You said what you wanted to do and what you have. What is the issue/error? If you just need to know how to do something, google(or bing/yahoo if you prefer) are wonderful search tools that can help you find what you need.

1 solution

Hi guys I have just decided to build xml tags withing the code and pass fields in there and got it working.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900