Hello, world!

It's time for Hello, world! programm. Let's select first N records using tools, schema and LINQ.  
MySqlConnection conn = new MySqlConnection("SERVER=localhost; DATABASE=employees;UID=root;PASSWORD=");
conn.Open();
DataSet ds = new DataSet("employees");
MySqlDataAdapter sda = new MySqlDataAdapter("select * from salaries", conn);
sda.Fill(ds, "salaries");

var result = 
    from s in ds.Tables["salaries"].AsEnumerable().Take(10)
    select s;

Listing. 1

Warning! Don't use the example in real application! Please leave a comment why it's bad designed.

No comments:

HOWTO: Repair Logitech M325 Mouse

FixIt says that you will find single screw under CE label. It isn't always true.