随笔分类 -  Linq基础

摘要:查询用的类,和对象 public class student { public string name { get; set; } public int age { get; set; } public int Igrades { get; set; } public order[] oders; } ... 阅读全文
posted @ 2012-03-19 16:45 高捍得 阅读(181) 评论(0) 推荐(0)
摘要:添加数据 DataClasses1DataContext datacontent; string str = ConfigurationManager.AppSettings["SQLString"].ToString(); datacontent = new DataClasses1DataContext(str);... 阅读全文
posted @ 2012-01-31 10:25 高捍得 阅读(353) 评论(0) 推荐(0)
摘要:简单查询 1.首先 ,新建一个LinqToSql类文件.把需要查询的表,拖入类文件的设计界面.接下来就可以使用它了. 2.页面拖一个GridView <asp:GridView ID="GridView1" runat="server"> </asp:GridView> 表信息: 3.后台代码 //实例化Linq链接... 阅读全文
posted @ 2012-01-30 17:44 高捍得 阅读(599) 评论(0) 推荐(0)
摘要:创建隐形局部变量查询数组并输出 string[] w = { "a", "b", "c" }; var word = from words in w select new { Upper = words.ToUpper(), Lower = words.ToLower() }; foreach (var item in word) { Resp... 阅读全文
posted @ 2012-01-30 16:28 高捍得 阅读(288) 评论(0) 推荐(0)