Chinese (People's Republic of China)  English  Français


Supinfo-Projects.com
Tous les projets des élèves ingénieurs de Supinfo



Projets
  Dernier Projet
  Les plus populaires
  Tous les Projets

148 Visiteurs
3168 Projets


My Supinfo-Projects

   Connectez-vous
   Créez un Compte


Synopsis

   118 Visites
   Note INTERNET : 14
    (5 Votants)
   5 Commentaires

   Lire l'article

Evaluez cet article

20
18
16
14
12
10
8
6
4
2
0


Commentez cet article

Auteur :

Email :

Votre commentaire :



 
2005 - Note de Synthèse Stage
TreeView width ASP.NET V2 – Whidbey
[20 mn de lecture - paru le 11/17/2004 3:27:26 PM - Public : Débutant]

Auteur

degrem_mMichel DEGREMONT
Elève-Ingénieur Supinfo Paris
Promotion SUPINFO 2006

   Lui écrire
   Tous les projets de cet auteur
   Le mini-CV de cet auteur

5. TreeView and data source DataSet

5.1. To fill DataSet

We have two tables. LuxuryCarVehicule which contact characteristics of the vehicle of which the Model field. And in our second luxuryCarMarque table which contact the mark of different conveys. These two tables are réliées between them by the key marqueID.

TreeView asp.net V2 whidbey

The TreeViewDataSet() method goes seeks the data in my data base SQLserver.

 

DataSet TreeViewDataSet() {
    SqlConnection myConnection = new SqlConnection(ConfigurationSettings.ConnectionStrings["AppConnectionStringCars"].ConnectionString);
   

    SqlDataAdapter dbLuxuryCarMarque = new SqlDataAdapter("SELECT dbo.luxuryCarMarque.marqueID ,dbo.luxuryCarMarque.marque FROM dbo.luxuryCarMarque WHERE (marqueID IN (SELECT dbo.luxuryCarVehicule.marqueID FROM dbo.luxuryCarVehicule GROUP BY dbo.luxuryCarVehicule.marqueID)) GROUP BY dbo.luxuryCarMarque.marque,dbo.luxuryCarMarque.marqueID ORDER BY dbo.luxuryCarMarque.marque ", myConnection);
 
    SqlDataAdapter dblLuxuryCarVehicule = new SqlDataAdapter("SELECT marqueID, model FROM luxuryCarVehicule", myConnection); 
   

    DataSet dst = new DataSet(); dbLuxuryCarMarque.Fill(dst, "Marque"); 
    dblLuxuryCarVehicule.Fill(dst, "Vehicule"); 
    dst.Relations.Add("Children", dst.Tables["Marque"].Columns["marqueID"],dst.Tables["Vehicule"].Columns["marqueID"]);

    return dst;

}

5.2. Creating TreeView Node 

The method void vehiculeNodes() goes contruire TreeView and its nodes.
The node child, represents the models of each Mark. The marks correspond to the main nodes.

The nodes children redirect on a URL.

void Page_Load(object sender, EventArgs e)
{
    vehiculeNodes();
}

void vehiculeNodes() {
     DataSet dst = TreeViewDataSet();
     foreach (DataRow masterRow in dst.Tables["Marque"].Rows) 
    {
         TreeNode masterNode = new TreeNode((string)masterRow["marque"]);
         TreeView1.Nodes.Add(masterNode);
         foreach (DataRow childRow in masterRow.GetChildRows("Children"))
         { 
                TreeNode childNode = new TreeNode((string)childRow["model"]);
                 masterNode.ChildNodes.Add(childNode);
                 childNode.NavigateUrl = "AllCars.aspx?searchByMarque=" + masterNode.Text 
                                           +        "&searchByAnnee&searchByKilometre=&searchByModele=" + childNode.Text; 
        }
     }
}

To slip TreeView into the zone Design. You can now compile.



Articles de la même catégorie

 Pages : Top


47 Visites
0 Commentaires
Introduction to COM
[10 mn de lecture - paru le 11/17/2004 3:06:03 PM - Public : Expert]

En savoir plus


77 Visites
0 Commentaires
Programming with GTK# and Mono
[40 mn de lecture - paru le 11/17/2004 2:31:35 PM - Public : Confirmé]

En savoir plus


65 Visites
0 Commentaires
Plugins management in PHP
[30 mn de lecture - paru le 11/17/2004 2:01:04 PM - Public : Expert]

En savoir plus

   Tous les Articles


SUPINFO Training Center peut vous proposer une formation ...

   Devenez Ingénieur Système Microsoft en 35 jours avec SUPINFO Training Center
   Devenez Certifiés Cisco en 13 jours avec SUPINFO Training Center
   Devenez Administrateur Système Microsoft avec SUPINFO Training Center
   Devenez Développeur Microsoft .NET en 13 jours avec SUPINFO Training Center



Powered by Campus-Booster Technology
Conditions d'utilisation & Copyright | Respect de la vie privée
© Copyright 1965-2006 Supinfo Paris, Paris Academy of Computer Science
Supinfo, Ecole Supérieure d'Informatique et Paris Academy Of Computer Science are trade marks.
23, rue de Château LANDON - 75010 PARIS - Phone : +33 (0) 153359 700 Fax : +33 (0) 153359 701

Web site autided by :