This is a discussion on Tips to write XML with attributes within the XML and SOAP forums, part of the Web Development category; hi all TestTableAdapter testRegistryTableAdapter = new TestRegistryTableAdapter(); TestRegistryTestRegistryDataTable testRegistryDataTable = new TestRegistry.TestRegistryDataTable(); testRegistryDataTable = testRegistryTableAdapter.GetData(); XmlTextWriter writer = new XmlTextWriter(Server.MapPath(&...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| hi all TestTableAdapter testRegistryTableAdapter = new TestRegistryTableAdapter(); TestRegistryTestRegistryDataTable testRegistryDataTable = new TestRegistry.TestRegistryDataTable(); testRegistryDataTable = testRegistryTableAdapter.GetData(); XmlTextWriter writer = new XmlTextWriter(Server.MapPath("example.xml"), null); //Write the root element writer.WriteStartElement("markers"); for (int i = 0; i < callRegistryDataTable.Count; i++) { writer.WriteStartElement("marker"); writer.WriteAttributeString("lat", testRegistryDataTable[i].Lat); writer.WriteAttributeString("lng", testRegistryDataTable[i].Long); writer.WriteEndElement(); } writer.WriteEndElement(); //Write the XML to file and close the writer writer.Close(); Regards Manivannan.s |
| Sponsored Links |
| |||
| hi smani.... i saw your code... i did'nt get the info your code exactly...... i am using C# .net(.net frame work 2.0), i haven't big idea about adapter also.... please tell me step by step what i do for this exactly.... |
| |||
| hi, Here is the step's I hope you are using visual studio 2005, 1.Create Dataset by clicking add new item on right click of your solution 2.open server explorer in view tab in vs2005. 3.drag and drop your table u need, it automatically create a adapter for your dataset. 4.create stored procedure there, if you need.(in my code i had used default function GetData()) 5.now go to your aspx.cs page, import your adapter namespace by using keyword Then use the above code, In my above code Wat i did was, 1.Created object for my adapter TestTableAdapter testRegistryTableAdapter = new TestRegistryTableAdapter(); 2.Table object, since my adapter function will return the result as table TestRegistryTestRegistryDataTable testRegistryDataTable = new TestRegistry.TestRegistryDataTable(); 3.now collecting the resultan data in my table testRegistryDataTable = testRegistryTableAdapter.GetData(); i hope it may be useful for u Regards Manivannan.s |
| |||
| Ya..nice example... thankx a lot to u.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I write a file from JavaScript? | itbarota | HTML, CSS and Javascript Coding Techniques | 5 | 10-26-2007 12:54 AM |
| What are the main attributes if test automation? | devarajan.v | Software Testing | 2 | 07-27-2007 06:30 AM |
| If I ask you to write 'VI' editor in C++ - How you'll proceed? | Sabari | C and C++ Programming | 0 | 07-23-2007 12:37 AM |
| Can I write sin(x) instead of Math.sin(x)? | prasath | Java Programming | 2 | 07-20-2007 07:38 AM |
| What’s the difference between Response.Write() andResponse.Output.Write()? | prasath | ASP and ASP.NET Programming | 1 | 07-19-2007 02:56 AM |