Convert a .NET DataReader (Any Type) to XML
Category:
C#, VB.NET, ASP.NETType:
SnippetsDifficulty:
IntermediateAuthor: sanjit tamhane
Version Compatibility: Visual Basic.NET
More information:
This is an extension to the code at http://www.freevbcode.com/ShowCode.asp?ID=5232, which converts a .NET SQLDataReader to XML. The enhancements are:
- Output XML data can be bind to DataGrid via Dataset in UI Layer
- Using IDataReader rather than SqlReader so can be used against any Data Provider.
- CreateCommand can be used against any data provider without parameters
Instructions: Copy the declarations and code below and paste directly into your VB project.
Declarations: