IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C# Discussion :

Lire des données dans un ListView en wpf


Sujet :

C#

  1. #1
    Invité
    Invité(e)
    Par défaut Lire des données dans un ListView en wpf
    Bonjour,j'aimerais savoir quelle est la façon la plus simple d'afficher les données d'une database dans un controle ListView(C# wpf).

    A vrai dire j'ai un ListView dont je souhaite remplir avec les données de ma table contenant des images et du texte.je ne sais pas comment faire en wpf

    voici mon xaml:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
     
     
     <ListView  x:Name="ListeView" >
            <ListView.View>
                <GridView>
                  <GridView.Columns>
     
                     <GridViewColumn Header="ID" Width="100">
     
                     </GridViewColumn>  
     
                     <GridViewColumn Header="Nom" Width="100">
     
                     </GridViewColumn>   
     
                    <GridViewColumn Header="AGE" Width="100">
     
                    </GridViewColumn>   
     
     
     
                   <GridViewColumn Header="IMAGE" Width="100">
     
                   </GridViewColumn>
     
               </GridView.Columns>
             </GridView>
         </ListView.View>
    </ListView>




    Merci pour votre reponse

  2. #2
    Membre extrêmement actif
    Inscrit en
    Avril 2008
    Messages
    2 573
    Détails du profil
    Informations personnelles :
    Âge : 65

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 573
    Par défaut
    Bonjour

    Pas difficile.
    Il faut un class auxiliaire StorePersons qui renverra le datatable...
    L'exemple suivant utilise notre auxiliaire StorePersons qui se charge de renvoyer :
    -un datatable Persons (cree par code pour illustration)
    -on se binde à sa vue par defaut via Path=Persons.DefaultView..

    Pour l'affichage de l'image,l'exemple utilise un datatemplate:
    -key => cellImageTemplate
    -base sur un datatype=>DataTable (il faut importer en xaml le namespace System.Data dans le concepteur => xmlns:sys="clr-namespace:System.Data;assembly=System.Data")....
    -le Source du Control Image est bindee au champ string IMAGE...
    Dans l'exemple le champ IMAGE est defini :
    -sur dossier Resources situe dans le repertoire de Ton Projet...(ou ce que tu voudras comme dossier...)....
    code behind .cs du class auxiliaire StorePersons
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    //ajouter ces ref ici 
    using System.Data;
    using System.ComponentModel;
    //cette ref illustre la procedure  GetPersons() version DB
    using System.Data.OleDb;
    namespace WpfListViewDataTable
    {
        public class StorePersons:INotifyPropertyChanged
        {
            public DataTable _Persons;
            public StorePersons()
            { 
            }
            public DataTable Persons
            {
                get 
                {
                    if (_Persons == null)
                    {
                        _Persons = GetPersons();
                    }
     
                   return  _Persons ;}
                set
                {
                    _Persons=value ;
                    OnPropertyChanged("Persons");
                } 
            }
     
            public DataTable GetPersons()
            {
                string[] arrChamps = new string[4]{
                    "ID","Nom","AGE","IMAGE"
                };
                DataTable  myDataTable = new DataTable();
                myDataTable.TableName="Persons";
                DataColumn dc;
                for (int i = 0; i < arrChamps.Length; i++)
                {
                    dc = new DataColumn();
                    dc.ColumnName = arrChamps[i];
                    dc.Caption = "Col "+arrChamps[i];
                    dc.DataType = typeof(string);
                    dc.DefaultValue = "vide";
                    myDataTable.Columns.Add(dc);
                }
                DataRow dr = myDataTable.NewRow();
                for (int i = 0; i < 21; i++)
                {
                    for (int j = 0; j < myDataTable.Columns.Count  ; j++)
                    {
                        switch (j)
    	                {
                            case 0:
                               dr[j] = "ItemID" + i.ToString();
                               break;
                            case 1:
                               dr[j] = "ItemNom" + i.ToString();
                               break;
                            case 2:
                               dr[j] = "ItemAGE" + i.ToString();
                               break;
                            case 3:
                               dr[j] = "Resources/Nenuphars.jpg" ;
                               break;
                            default:
                                break;
    	                }
                    }
                    myDataTable.Rows.Add(dr); 
                    dr = myDataTable.NewRow();
                }
     
                myDataTable.Rows.Add(dr); 
                return myDataTable;
            }
     
           #region INotifyPropertyChanged Membres
     
            public event PropertyChangedEventHandler PropertyChanged;
            private void OnPropertyChanged (string propName )
            {
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(propName));
                }
            }
            #endregion
        }
    }
    code xaml du listview:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
     
    <Window x:Class="WpfListViewDataTable.WinBindToDataTable"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:WpfListViewDataTable"
            xmlns:sys="clr-namespace:System.Data;assembly=System.Data"
            Title="MainWindow" Height="350" Width="525">
        <Window.Resources>
            <local:StorePersons x:Key="source"></local:StorePersons>
     
            <!--DataTemplate pour l'image-->
            <DataTemplate x:Key="cellImageTemplate"
                          DataType="{x:Type sys:DataTable}">
                <StackPanel Margin="5">
                    <Image Width="50" Source="{Binding Path=IMAGE}"/>
                </StackPanel>
            </DataTemplate>
        </Window.Resources>
     
        <!--binding est fait au niveau du stackpanel "root" pour
        en faire beneficier tout le monde y compris les 2 textblock
        IsSynchronizedWithCurrentItem pour synchroniser la navigation-->
     
        <StackPanel 
            x:Name="root"
            DataContext="{Binding Source={StaticResource source},Path=Persons.DefaultView}">
            <ListView  
                Height="200"
                x:Name="ListeView" 
                IsSynchronizedWithCurrentItem="true"
                ItemsSource="{Binding}">
                <ListView.View>
                    <GridView>
                        <GridView.Columns>
                            <GridViewColumn Header="ID" Width="100"
                                            DisplayMemberBinding="{Binding Path=ID}">
                            </GridViewColumn>
                            <GridViewColumn Header="Nom" Width="100"
                                            DisplayMemberBinding="{Binding Path=Nom}">
                            </GridViewColumn>
                            <GridViewColumn Header="AGE" Width="100"
                                            DisplayMemberBinding="{Binding Path=AGE}">
                            </GridViewColumn>
                            <GridViewColumn Header="IMAGE" Width="100"  
                                            CellTemplate="{StaticResource cellImageTemplate}" >
                            </GridViewColumn>
                        </GridView.Columns>
                    </GridView>
                </ListView.View>
            </ListView>
            <StackPanel  
                Orientation="Horizontal" >
                <TextBlock 
                    Margin="10"
                    Padding="5"
                    x:Name="tbID"
                    FontSize="16"
                    FontWeight="Bold" 
                    Foreground="White" 
                    Background="Red" 
                    Text="{Binding ID}">
                </TextBlock>
                <TextBlock 
                    Margin="10"
                    Padding="5"
                    x:Name="tbNom"
                    FontSize="16"
                    FontWeight="Bold" 
                    Foreground="White" 
                    Background="DarkBlue" 
                    Text="{Binding Nom}">
                </TextBlock>
            </StackPanel>
     
        </StackPanel >
    </Window>
    La procedure GetPersons() dans le cas reel d'une table en BD Type OleDB (ou SqlClient) serait:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
     
     //cette ref illustre la procedure  GetPersons() version DB
    using System.Data.OleDb;
     
     
    public DataTable GetPersonsVersusDB()
         {
                string strCON = "";
                OleDbConnection con = new OleDbConnection(strCON );
     
                con.Open();
                string strSQL = "SELECT * FROM Persons;";
                OleDbCommand cmd = new OleDbCommand();
                cmd.CommandText = strSQL;
                cmd.Connection = con;
                OleDbDataAdapter TonDataAdapter = new OleDbDataAdapter(cmd.CommandText,cmd.Connection);
                DataSet TonDataSet = new DataSet();
                TonDataAdapter.Fill(TonDataSet, "Persons");
                return TonDataSet.Tables[0];
            }
    bon code....

  3. #3
    Invité
    Invité(e)
    Par défaut
    bonjour,
    j'ai reussi à afficher les autres données sauf l'image que j'ai enregistré sous forme binaire mais je ne sais pas comment le recuprerer en format BitmapImage.

    Voici mon code

    xaml de l'image dans la ListView
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
     
      <ListView x:Name="listDonne" HorizontalAlignment="Left" Height="246" Margin="20,371,0,0" VerticalAlignment="Top" Width="358" Cursor="Hand">
                <ListView.View>
                    <GridView>
     
       <GridViewColumn Header="ID">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding ID}" Margin="30,0,0,0" HorizontalAlignment="Stretch"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
     
                        <GridViewColumn Header="NOM">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Nom}" Margin="30,0,0,0" HorizontalAlignment="Stretch"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
    ................
     
     <GridViewColumn Header="FRUIT">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Image Source="{Binding image}"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
    .................
     
     </GridView>
     
     
     
                </ListView.View>
            </ListView>

    ma classe de propriété

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
     public class Arbre
        {
           public int ID { get; set; }
            public string Nom { get; set; }
            public int Age { get; set; }
            public BitmapImage image { get; set; }
            public string Desc { get; set; }
            public string Comes { get; set; }
    le code source
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
     
     public partial class TestWindow1 : Window
        {
            OpenFileDialog fd = new OpenFileDialog();
            List<Arbre> arbre = new List<Arbre>();
            Convertisseur cnt = new Convertisseur();
            public TestWindow1()
            {
                InitializeComponent();
                LordData();
            }
     
      //recuperation des données
            void LordData()
            {
     
                try
                {
                    using (SqlConnection cnx = new SqlConnection(Properties.Settings.Default.ChaineDeConnxion))
                    {
                        cnx.Open();
                        byte[] im = null;
                        ListViewItem list = new ListViewItem();
                        using (SqlCommand cmd = new SqlCommand("select *from Arbres", cnx))
                        {
                            SqlDataReader rd = cmd.ExecuteReader();
     
                            while (rd.Read())
                            {
     
                                arbre.Add(new Arbre() { ID = Convert.ToInt32(rd[0]), Nom = rd[1].ToString(), Age = Convert.ToInt32(rd[2]), image =new BitmapImage(new Uri( Convert.ToString(rd[3]))), Desc = rd[4].ToString(), Comes = rd[5].ToString() });
     
                            }
                            listDonne.ItemsSource = arbre;
                            rd.Close();
                        }
     
                        cnx.Close();
                    }
                }
                catch (Exception ex)
                {
     
                    MessageBox.Show(ex.Message);
                }
     
            }
    aidez-moi svp je coince fort

  4. #4
    Membre extrêmement actif
    Inscrit en
    Avril 2008
    Messages
    2 573
    Détails du profil
    Informations personnelles :
    Âge : 65

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 573
    Par défaut
    re

    Avec des images en "blob binaire" dans la BD ca se complique.
    Vu que le class BitmapImage exige un "path" ( UriSource => string)
    vers un fichier de type Bitmap.
    Il faut "streamer" chaque blob en Bitmap dans un folder temporaire du projet Application...et donner son "path" comme UriSource à chaque BitmapImage...
    le code suivant :
    1/ cree un dossier temporaire("TempFolder") pour stocker les images bmp "deblobes" dans le repertoire d'application...

    2/utilise un filestream pour ecrire chaque "blob" sous forme d'un fichier extension .bmp dans TempFolder...

    3/utilise un path vers ce dossier TempFolder:
    -"FolderTemp"+"photoID.bmp" comme UriSource.

    4/NB :
    Quand on veut lire un champ "blob" avec le Reader :
    -il faut lire d'abord les champs qui le precedent dans l'ordre de la table en BD...
    -dans Reader.GetBytes(int ordinal , etc) ordinal est le numero du champ "blob"..en BD


    code behind .cs du class Arbre liftee (nom de prop en maj SVP):
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Media.Imaging;
     
    namespace WpfListViewDataTable
    {
        public class Arbre
        {
            public int ID { get; set; }
            public string Nom { get; set; }
            public int Age { get; set; }
            public BitmapImage BitmapImage { get; set; }
            public string Desc { get; set; }
            public string Comes { get; set; }
        }
    }
    code xaml du winform deja donne (le "celltemplate" est modifie pour integer ton class Arbre):
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
     
    <Window x:Class="WpfListViewDataTable.WinLoadTableArbre"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:WpfListViewDataTable"
            Title="WinLoadTableArbre" Height="300" Width="300">
        <Window.Resources>
     
            <!--DataTemplate pour l'image REVU POUR LE CLASS ARBRE -->
            <DataTemplate x:Key="cellImageTemplate"
                          DataType="{x:Type local:Arbre }">
                <StackPanel Margin="5">
                    <Image Width="50" Source="{Binding Path=BitmapImage.UriSource }"/>
                </StackPanel>
            </DataTemplate>
        </Window.Resources>
        <StackPanel>
            <Button 
                x:Name="btnLoadTableArbre"
                Content="Load Display Table Arbre"
                Click="btnLoadTableArbre_Click" >
     
            </Button>
            <ListView  
                Height="200"
                x:Name="listViewDonne" 
                IsSynchronizedWithCurrentItem="true"
                ItemsSource="{Binding}">
                <ListView.View>
                    <GridView>
                        <GridView.Columns>
                            <GridViewColumn Header="ID" Width="100"
                                            DisplayMemberBinding="{Binding Path=ID}">
                            </GridViewColumn>
                            <GridViewColumn Header="Nom" Width="100"
                                            DisplayMemberBinding="{Binding Path=Nom}">
                            </GridViewColumn>
                            <GridViewColumn Header="Age" Width="100"
                                            DisplayMemberBinding="{Binding Path=AGE}">
                            </GridViewColumn>
                            <GridViewColumn Header="Image" Width="100"  
                                            CellTemplate="{StaticResource cellImageTemplate}" >
                            </GridViewColumn>
                        </GridView.Columns>
                    </GridView>
                </ListView.View>
            </ListView>
        </StackPanel>
    </Window>
    code behind .cs du winform:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;
    using System.Data;
    using System.Data.SqlServerCe;
    using System.IO;
    namespace WpfListViewDataTable
    {
        /// <summary>
        /// Logique d'interaction pour WinLoadTableArbre.xaml
        /// </summary>
        public partial class WinLoadTableArbre : Window
        {
            List<Arbre> arbres = new List<Arbre>();
            public WinLoadTableArbre()
            {
                InitializeComponent();
            }
            // => FolderTemp est un dossier temporaire ou sont stockes
            // les images "blob" de la table apres lecture...
            string pathFolder = string.Empty;
     
            string appPath = Directory.GetCurrentDirectory() + @"\";
            private void btnLoadTableArbre_Click(object sender, RoutedEventArgs e)
            {
                string cnStr = GetConnectionString();
     
                // cree FolderTemp .
                 pathFolder = appPath + @"\FolderTemp\";
                 if (!Directory.Exists(pathFolder))
                {
                    Directory.CreateDirectory(pathFolder);
                }
     
                LoadTable(cnStr);
            }
            private void  LoadTable(string connectionString)
            {
                    try
                    {
                        using (SqlCeConnection cnx = new SqlCeConnection(connectionString))
                        {
                            cnx.Open();
                            using (SqlCeCommand cmd = new SqlCeCommand("SELECT ID, Nom, Age, BitmapImage,Description, Comes FROM Arbre", cnx))
                            {
     
                                FileStream stream;                      // => pour ecrire  BLOB dans un file (*.bmp) dans TempFolder.                    
                                BinaryWriter writer;                    // =>pour  "streamer" le BLOB dans FileStream .
                                int bufferSize = 100;                   // taille buffer BLOB .               
                                byte[] outByte = new byte[bufferSize];  // buffer  lecture outByte[] remplit par GetBytes.
                                long retval=0;                          // nb  bytes renvoye par GetBytes.
                                long startIndex = 0;                    // position depart dans la sortie .             
                                int  tempID = 0;
                                string tempNom = "";
                                int tempAge = 0;
                                string tempUriImage = "";
                                string tempDesc = "";
                                string tempComes = ""; 
                                SqlCeDataReader rd = cmd.ExecuteReader(CommandBehavior.SingleResult);
     
                                while (rd.Read())
                                {
                                    // lit champs en sequence(ordre) dans table.
                                    tempID = rd.GetInt32(0);
                                    tempNom = rd.GetString(1);
                                    tempAge = rd.GetInt32(2);
     
                                    // cree un nouveau file bitmap de sortie.
                                    stream = new FileStream(
                                    pathFolder + "photo" + tempID.ToString() + ".bmp", FileMode.OpenOrCreate, FileAccess.Write);
                                    writer = new BinaryWriter(stream);
     
                                    // byte depart => nouveau record BLOB.
                                    startIndex = 0;
     
                                    // lit  dans outByte[] & store nbre de bytes lus.
                                    //ATTENTION : ce "3" est le numero record du champ  BitmapImage dans table BD
     
                                    retval = rd.GetBytes(3, startIndex, outByte, 0, bufferSize);
     
                                    // tant que 
                                    while (retval == bufferSize)
                                    {
                                        writer.Write(outByte);
                                        writer.Flush();
     
                                        // Repositionne index depart à derniere sortie.
                                        startIndex += bufferSize;
     
                                        //ATTENTION : au "3"
                                        retval = rd.GetBytes(3, startIndex, outByte, 0, bufferSize);
                                    }
     
                                    // ecrit le restant du buffer.
                                    writer.Write(outByte, 0, (int)retval - 1);
                                    writer.Flush();
     
                                    // Ferme stream.
                                    writer.Close();
                                    stream.Close();
     
                                    //Lit la suite des champs
                                    tempDesc = rd.GetString(4);
                                    tempComes=rd.GetString(5);
                                    //recupere uri de l'image ...pour la donner à  BitmapImage
                                    tempUriImage = pathFolder + "photo" + tempID.ToString() + ".bmp";
     
                                    arbres.Add(new Arbre() { 
                                        ID = tempID ,
                                        Nom = tempNom ,
                                        Age = tempAge ,
                                        BitmapImage = new BitmapImage(new Uri(tempUriImage, UriKind.RelativeOrAbsolute)),
                                        Desc = tempDesc , 
                                        Comes = tempComes});
     
                                }
                                listViewDonne.ItemsSource = arbres;
                                rd.Close();
                            }
     
                            cnx.Close();
                        }
                    }
                    catch (Exception ex)
                    {
     
                        MessageBox.Show(ex.Message);
                    }
     
     
            }
            private static string GetConnectionString()
            {
                 return Properties.Settings.Default.ArbreBDCnStr;
            }
        }
    }
    Bon code....

  5. #5
    Invité
    Invité(e)
    Par défaut
    merci beaucoup,

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 6
    Dernier message: 02/12/2010, 22h04
  2. Reprendre des données dans une listview (c#)
    Par miky-mike dans le forum Windows Forms
    Réponses: 2
    Dernier message: 24/05/2010, 11h48
  3. Insérer des données dans une ListView
    Par Vincinho dans le forum VB.NET
    Réponses: 3
    Dernier message: 18/05/2010, 17h08
  4. Réponses: 4
    Dernier message: 19/02/2008, 00h24
  5. [VBS]Lire des données dans un fichier .txt
    Par kacxial dans le forum VBScript
    Réponses: 4
    Dernier message: 28/02/2007, 13h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo