Teach Yourself Visual Studio® .NET 2003 in 21 Days [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Teach Yourself Visual Studio® .NET 2003 in 21 Days [Electronic resources] - نسخه متنی

Jason Beres

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید









Q&A










Q1:

You showed me a couple ways to load XML documents. Which is the best way to load an XML document?


A1:

The best way might not be the easiest way. Using the XmlDocument class with DOM gives you great flexibility, but at the cost of resources. Using the XmlTextReader is super fast and efficient, but it's a forward-only stream, so you might find it limited. Loading an XML document into a DataSet is easy too, but you must be familiar with navigating tables and rows in a DataSet to work effectively with the XML document. So, the short answer is that there's no single best way; there's only a best way based on what you need to do with the data and what syntax you are familiar with.

Q2:

Why go through all the trouble of creating schemas in the designer when I can just use the WriteXmlSchema method of the DataSet class?


A2:

Using the WriteXmlSchema method is an easy way to get a schema from tables in a database, but it might not build the schema correctly based on the hierarchy you're looking for. If you build a few more schemas with the Schema Designer, you'll realize it's as easy as creating a table in SQL Server and calling WriteXmlSchema.

Q3:

You aren't showing me how to do any of this in ASP.NET. Why?


A3:

All the code you wrote today can be cut and pasted directly into an ASP.NET application and run without modification. The DataGrid in Windows Forms correctly displays the hierarchy of the data, but the Web Forms DataGrid doesn't, so I wanted you to get an idea of what the data looks like in real life, not in the flat grid on a Web page. It's very easy to see how to write data back to an XML file using the DataGrid. This is still possible in ASP.NET, but not with the grid control.

Q4:

I'm hungry for more XML. Where do I go next?


A4:

If you're a hardcore XML developer, a must-have book on the shelf is XML for ASP.NET, by Dan Wahlin. That book covers pretty much everything you'd ever need to know about XML and .NET. I highly recommend it.

Online, the MSDN XML Developer Center is jam-packed with XML programming information. You can find it at the following URL:

http://www.msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28000438

Also on Microsoft.com is the XML series of online seminars. I recommend viewing the seminar about transforming XML with XSLT in .NET, which is important but beyond the scope of this book:

http://support.microsoft.com/default.aspx?scid=kb;en-us;q326069

If you need some other great examples of using XSLT to transform XML, check out the XSLT Stylesheet Library at http://www.xmlpitstop.com. There are tons of great examples of transforming XML with XSLT in .NET.


/ 270