Tuesday, 20 August 2013

Retrieve all records from database

sampleDataContext sdc = new sampleDataContext();
   //var data = from d in sdc.ToyShops select d ;(retrieve all records)
   var data = from d in sdc.ToyShops select new { id=d.toyId,name=d.toyname};// retrieve selected column

   dataGridView1.DataSource = data;

No comments:

Post a Comment