• wp8 入门到精通 LINQ to SQL


     http://msdn.microsoft.com/zh-cn/library/bb397924.aspx LINQ 查询操作中的类型关系 (C#)

    使用一个人类发明快速检索的方法

    // Northwnd inherits from System.Data.Linq.DataContext.
    Northwnd nw = new Northwnd(@"northwnd.mdf");
    // or, if you are not using SQL Server Express
    // Northwnd nw = new Northwnd("Database=Northwind;Server=server_name;Integrated Security=SSPI");
    
    var companyNameQuery =
        from cust in nw.Customers
        where cust.City == "London"
        select cust.CompanyName;
    
    foreach (var customer in companyNameQuery)
    {
        Console.WriteLine(customer);
    }

    在上面的代码中,创建了 nw 对象来表示 Northwind 数据库,将 Customers 表作为目标,筛选出了来自 London的 Customers 行,并选择了一个表示 CompanyName 的字符串以进行检索。

    执行循环时,将检索到 CompanyName 值的集合

    http://msdn.microsoft.com/zh-cn/library/windowsphone/develop/bb399398(v=vs.100).aspx

    http://www.cnblogs.com/lyj/archive/2008/01/28/1056133.html

    Linq:基本语法form ,select, where(2)

    http://www.cnblogs.com/liulun/archive/2009/06/02/1494740.html

    时间排序 

    string[] datatime = { "2014-03-28 19:21:03", "2014-03-28 12:39:14", "2014-03-28 13:52:49", "2014-03-29 20:23:36", "2014-03-29 18:32:35", "2014-03-29 18:02:49", "2014-03-29 07:46:48", "2014-03-30 13:28:40", "2014-03-30 19:30:36", "2014-03-30 23:58:53" };
    List<Product> msgs = new List<Product>();
    for (int i = 0; i < datatime.Length; i++)
    {
    Product p1 = new Product();
    p1.Name = "张" + i + " ";
    p1.Age = Convert.ToString(20 + new Random().Next(0, 12));
    p1.Data = datatime[i];
    msgs.Add(p1);
    }


    var dor = from d in msgs orderby d.Data select d;

    this.listBox1.ItemsSource = dor;

    using (PersonDB per = new PersonDB())
    {
    if (!per.DatabaseExists())
    per.CreateDatabase();

    Person p1 = new Person();
    p1.Name = "张三";
    p1.Age = 3;
    per.Persons.InsertOnSubmit(p1);
    Classes c1 = new Classes();
    c1.CName = "san";
    c1.Content = "111";
    per.Classesss.InsertOnSubmit(c1);
    per.SubmitChanges();
    }

    这个俩个表都插入了

    http://blog.csdn.net/qinyuanpei/article/details/23869275 [Unity3D]Unity3D游戏开发之仿仙剑奇侠传角色死亡效果实现

  • 相关阅读:
    DevExpress的GridControl的实时加载数据解决方案(取代分页)
    WinForm程序虚拟分页(实时加载数据)
    C#使用反射特性构建访问者模式
    WinApi学习笔记内存的复制,填充,输出等操作
    PL/SQL学习笔记程序包
    WinApi学习笔记创建进程
    PL/SQL学习笔记触发器
    WinApi学习笔记获取光驱中的信息
    WinApi学习笔记读写文件
    不通过配置文件启动WCF服务
  • 原文地址:https://www.cnblogs.com/luquanmingren/p/3637622.html
Copyright © 2020-2023  润新知