0

I am trying to figure out how to bring out some kind of table to view the DataSet that has been populated. I cannot properly visualize the code as it is.

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using MySql.Data;
using MySql.Data.MySqlClient;

namespace Decoupled_Data
{
    class Program
    {
        static void Main(string[] args)
        {
            string connStr =
                "server=localhost; user=root; database=job_ticket_foil_summary;port=3306;password=ttnstamping";
            MySqlConnection conn = new MySqlConnection(connStr);

            DataSet dsCountry = new DataSet();

            string sql = "SELECT * FROM jt_foil_summary";
            MySqlDataAdapter daCountry = new MySqlDataAdapter(sql, conn);

            MySqlCommandBuilder cb = new MySqlCommandBuilder(daCountry);

            daCountry.Fill(dsCountry, "jt_foil_summary");

            //Table of Data should appear here

            Console.ReadLine();
        }
    }
}
Pherdindy
  • 1,168
  • 7
  • 23
  • 52
  • What are you targetting: Winforms, WPF, ASP..? __Always__ TAG your question correctly! - Winforms : DataGridView – TaW Mar 10 '18 at 07:53
  • Sorry WPF would be ideal – Pherdindy Mar 10 '18 at 07:54
  • @MarcSantos, if WPF is ideal, start with creating WPF project, not just console. [this small example](https://stackoverflow.com/a/44206066/1506454) shows how to display DataTable in wpf – ASh Mar 10 '18 at 08:05
  • @Ash thanks for that tip. I'm relatively new to C# and i'm confused how to test the MySql objects – Pherdindy Mar 10 '18 at 11:44
  • 1
    `how to test the MySql objects` ?? What does this mean? – Chetan Mar 10 '18 at 11:52
  • The DataSet rather isn't it under Mysql.Data? Sorry it's System.Data :(. I apologize for my terms – Pherdindy Mar 10 '18 at 11:54

0 Answers0