C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




pls solve the error in below code..(XML)


Posted Date: 31 Jul 2008      Total Responses: 2

Posted By: Balaya       Member Level: Gold     Points: 1



The error is in this line
//Output this XML document
doc.Save(Console.Out); //i was not getting o/p to browser window.how to write it?
**************************
The code is as given below

//Create an ODBC connection to the database. Here it is an Access file
OdbcConnection conn = new OdbcConnection("DSN=XmlDb_NorthWind");

//Create a DataSet with a name "XmlDb"
DataSet dataset = new DataSet("XmlDb");

//Create a DataAdapter to load data from original data source to the DataSet
OdbcDataAdapter adapter = new OdbcDataAdapter();
adapter.SelectCommand = new OdbcCommand("SELECT * FROM Customers", conn);
adapter.Fill(dataset, "Customers");

//Create a virtual XML document on top of the DataSet
XmlDataDocument doc = new XmlDataDocument(dataset);

//Output this XML document
doc.Save(Console.Out);





Responses

Author: VijayaShankar    31 Jul 2008Member Level: GoldRating:     Points: 2

Console.Out is a read only property so you are gettin an error.
Try with TextWriter.

Regards,
Vijay



Author: ANIL PANDEY    01 Aug 2008Member Level: DiamondRating:     Points: 2



Use XMLtextReader and XMLTextWriter for Reading or Writing the XML

This Will not Give any Error

Tnanks
Anil

Thanks & Regards
Anil Kumar Pandey



Post Reply
You must Sign In to post a response.
Next : How to store XML File In String Builder
Previous : accesing xml data source
Return to Discussion Forum
Post New Message
Category: XML

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use