49,779 Members
1 added today
332,326 Resources
177 added today

All Devdex   All Gurus  

Binding Asp:menu to dynamically generated SiteMapPath file
Author: Himanshu Dhami
Rating: Rate this Resource
Visits: 12327

Discuss in Newsgroups

Page:

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();


Next Page >>

Visitor Comments

Be the first to rate this article!

 

Rate this Article







	
	
	



ASP.NET Chart Control.
Charts from your Database.
Live Demo & FREE Trial!

ASP ArticlesThis category has been added to your weekly newsletter
ASP Web Sites
ADSI & WSH BooksThis category has been added to your weekly newsletter
FREE ComponentsThis category has been added to your weekly newsletter
ASP EventsThis category has been added to your weekly newsletter
ASP HeadlinesThis category has been added to your weekly newsletter

CSharp ArticlesThis category has been added to your weekly newsletter
C# Web SitesThis category has been added to your weekly newsletter

SQL ArticlesThis category has been added to your weekly newsletter
SQL Events
SQL HeadlinesThis category has been added to your weekly newsletter
SQL Jobs

Jobs in CaliforniaThis category has been added to your weekly newsletter

XML ArticlesThis category has been added to your weekly newsletter
XML BooksThis category has been added to your weekly newsletter
XML Web Sites
XML Tutorials

free asp host

"Alex Homer"This search has been added to your weekly newsletter

Edit My Favorites Edit Profile & Favorites

 




Developersdex Home | ASP | C# | SQL | VB | XML | Gurus
Add Your Link | Add Your Code | FAQ | Advertise | Link To Us | Contact Us |
Copyright © 2010 Developersdex™. All rights reserved.