This article demonstrates the ASP.net 2.0 ability to extend the menu generation using SiteMapPath.
Here I will be showing how to generate the Web.Sitemap file using XmlTextWrite at runtime retrieving the data from SqlServer.
First I would like to show you the database structure, I have two tables in the database:
1.Master
2.Child
Following are the screenshots of both tables
Master:

Child:

To fetch the data from the database, I have created two connections, following is the code to do this:
string
_sqlconnString = "server=yoursever;User ID=sa;Password=sa;database=test";
SqlConnection source = new SqlConnection(_sqlconnString);
// Create destination connection
SqlConnection destination = new SqlConnection(_sqlconnString);
//Open connections
source.Open();
destination.Open();
// Select data from Products table
SqlCommand cmd = new SqlCommand("SELECT * FROM Master", source);
SqlCommand cmd1 = new SqlCommand("SELECT * FROM Child", destination);
// Execute reader
SqlDataReader reader1 = cmd.ExecuteReader();