// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Data; using System.Drawing; using System.Windows.Forms; namespace E { public class MainForm : Form { private DataGrid dataGrid1; public MainForm() { InitializeComponent(); } [STAThread] public static void Main(string[] args) { Application.Run(new MainForm()); } private void InitializeComponent() { dataGrid1 = new DataGrid(); ((System.ComponentModel.ISupportInitialize)(dataGrid1)).BeginInit(); SuspendLayout(); DataSet ds = new DataSet(); ds.ReadXml("http://www.nationalbanken.dk/dndk/valuta.nsf/valuta.xml"); dataGrid1.DataSource = ds.Tables["currency"]; dataGrid1.HeaderForeColor = SystemColors.ControlText; dataGrid1.Location = new Point(50, 50); dataGrid1.Size = new Size(400, 600); ClientSize = new Size(500, 700); Controls.Add(dataGrid1); Text = "Demo"; ((System.ComponentModel.ISupportInitialize)(dataGrid1)).EndInit(); ResumeLayout(false); } } }