lundi 21 mars 2016

How to display sqlite data to WPF app to look like this?

I want to display the content of a sqlite table to look something like this:

Image1

so far i have this:

        public void printHighscores()
    {
        connectToDatabase();
        string sql = "select * from Pacientes";
        SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
        SQLiteDataReader reader = command.ExecuteReader();
        int a = 0;
        while (reader.Read())
        {
            //Console.WriteLine("Name: " + reader["nombre"] + "\tEmail: " + reader["correo"] + "PEso: " + reader["peso"]);
            System.Windows.Controls.Button newBtn = new Button();
            a++;
            newBtn.Content = reader["nombre"];
            newBtn.Name = "Button" + a;

            Wrapsito.Children.Add(newBtn);

        }
        m_dbConnection.Close();
    }

and the display its this:

image2

Any tutorial, metod, workaround would be highly wanted =) Thanks in advance

Aucun commentaire:

Enregistrer un commentaire