HI
I am trying to Create a XML file in Visual Studio Using C sharp. I am using Customer table of Northwind database. Can someone help me out because i could not find what i am looking for. Below is my requirement.
A:
I want to create a c# GetCustomerXML method which have parameter to be pass to my Select statement in the WHERE clause and Generate the XML output file on my hard disk.
For Example
GetCustomer(String Country) Country will be use as parameter in Where clause sothat it will return whatever country have customers.
B:
At the end when xml file created another statement runs and add some more line at the bottom if i want Company name if they belong to some other city(Like London). See at end of XML file Let say my choice is london it will have line at bottom saying these are the company name.
<customer>
<CustomerID>ALFKI</CustomerID>
<CompanyName>Alfreds Futterkiste</CompanyName>
<ContactName>Maria Anders</ContactName>
<ContactTitle>Sales Representative</ContactTitle>
<Address>Obere Str. 57</Address>
<City>Berlin</City>
<PostalCode>12209</PostalCode>
<Country>Germany</Country>
<Phone>030-0074321</Phone>
<Fax>030-0076545</Fax>
</customer>
<customer>
<CustomerID>ANATR</CustomerID>
<CompanyName>Ana Trujillo Emparedados y helados</CompanyName>
<ContactName>Ana Trujillo</ContactName>
<ContactTitle>Owner</ContactTitle>
<Address>Avda. de la Constituci¢n 2222</Address>
<City>M‚xico D.F.</City>
<PostalCode>05021</PostalCode>
<Country>Mexico</Country>
<Phone>(5) 555-4729</Phone>
<Fax>(5) 555-3745</Fax>
</customer>
<customer>
<CustomerID>ANTON</CustomerID>
<CompanyName>Antonio Moreno Taquer¡a</CompanyName>
<ContactName>Antonio Moreno</ContactName>
<ContactTitle>Owner</ContactTitle>
<Address>Mataderos 2312</Address>
<City>M‚xico D.F.</City>
<PostalCode>05023</PostalCode>
<Country>Mexico</Country>
<Phone>(5) 555-3932</Phone>
</customer>
<CustomerName>
<companyname>Blauer See Delikatessen</companyname><
companyname>Blondesddsl pŠre et fils</companyname><
companyname>B¢lido Comidas preparadas</companyname><companyname>Bon app'</companyname>
</CustomerName>
Thanks