LINQ

...now browsing by tag

 
 

LINQ to SQL – Not Dead

Monday, November 3rd, 2008

For those who are not aware, last week there has been some misunderstanding regarding the future of LINQ to SQL based on announcements made by MS at PDC. Well after reading a few blogs around the Blogosphere I have come accross the following posts which explain that there is future for L2S:

Read Damien Guard’s blog ->http://damieng.com/

Read Huagati’s Blog -> http://blog.huagati.com/res/index.php/2008/11/03/quiet-blog-gone-fishing-is-linq-to-sql-dead-etc/

Further I found this cool image supporing L2S here

Long live LINQ to SQL !!!

Long live LINQ to SQL !!!

Written by Deepak Vasa - Visit Website

LINQ query to get all the column names in the DBML tables

Friday, October 31st, 2008

// LINQ query to get all the column names for every Table
var model = new AttributeMappingSource().GetModel(typeof(ReportDBMLClassesDataContext));
int i = 0;
ArrayList lblList = new ArrayList();
foreach (var mt in model.GetTables())
{
i++;
Label lbl = new Label();
lbl.Text = mt.TableName.ToString();
lbl.ID = “lbl” + i;
Panel1.Controls.Add(lbl);
Panel1.Controls.Add(new LiteralControl(“<br>”));
int r = 0;
foreach (var dm in mt.RowType.DataMembers)
{
r++;
Label rlbl = new Label();
rlbl.Text = dm.MappedName.ToString();
rlbl.ID = “rlbl” + i + “” + r;
Panel1.Controls.Add(rlbl);
Panel1.Controls.Add(new LiteralControl(“<br>”));
}
}

Written by Deepak Vasa - Visit Website