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游戏开发之仿仙剑奇侠传角色死亡效果实现

wp8 入门到精通 LINQ to SQL的更多相关文章

  1. wp8 入门到精通 虚拟标示符 设备ID

    //获得设备虚拟标示符 wp8 public string GetWindowsLiveAnonymousID() { object anid = new object(); string anony ...

  2. wp8 入门到精通 WebClient Post

    WebClient wc = new WebClient(); var URI = new Uri("http://your_uri_goes_here"); //If any e ...

  3. wp8 入门到精通 ---时间

    DateTime.Now.ToShortTimeString()DateTime dt = DateTime.Now;dt.ToString();//2005-11-5 13:21:25dt.ToFi ...

  4. wp8 入门到精通 仿美拍评论黑白列表思路

    static bool isbool = false; private void BindGameDelete() { Tile tile = new Tile(); List<Color> ...

  5. wp8 入门到精通 生命周期

  6. wp8 入门到精通 定时更新瓷贴

    public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Disp ...

  7. wp8 入门到精通 ImageCompress 图片压缩

    //实例化选择器 PhotoChooserTask photoChooserTask = new PhotoChooserTask(); BitmapImage bimg; int newPixelW ...

  8. wp8 入门到精通 Gallery

    <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.Resources> ...

  9. wp8 入门到精通 MultiMsgPrompt

    List<NotifyMsg> arraymsg = new List<NotifyMsg>(); List<NotifyInfo> ArrayNotifyInfo ...

随机推荐

  1. JS参考书籍

    参考书籍 初级读物:<JavaScript高级程序设计>:一本非常完整的经典入门书籍,被誉为JavaScript圣经之一,详解的非常详细,最新版第三版已经发布了,建议购买. 中级读物:&l ...

  2. Python序列的切片操作与技巧

    切片操作 对于具有序列结构的数据来说,切片操作的方法是:consequence[start_index: end_index: step]. start_index: 表示是第一个元素对象,正索引位置 ...

  3. UICollectionViewController用法

    在iOS 6 发布前,开发人员习惯使用UITableView来展示几乎所有类型的数据集合.ios 6 为 IOS 引入了全新的控制器,用来显示数据集合,集合视图控制器是与表视图控制器类似的全新UI框架 ...

  4. 新浪微博客户端(10)-切换多个fragment

    ViewController.m #import "ViewController.h" #import "DJOneViewController.h" #imp ...

  5. winscp私钥如何生成

    问题1,我用SecureCRT 5.0的自带工具生成了密钥和公钥(分别是不带后缀名的密钥文件和.pub的公钥文件),传上服务器也可以正常使用.     但是我用其它一些客户端工具连接时需要的密钥文件是 ...

  6. jQuery 事件用法详解

    jQuery 事件用法详解 目录 简介 实现原理 事件操作 绑定事件 解除事件 触发事件 事件委托 事件操作进阶 阻止默认事件 阻止事件传播 阻止事件向后执行 命名空间 自定义事件 事件队列 jque ...

  7. Jquery validate插件使用方法详解

    html: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Reg.aspx.c ...

  8. vmware, failed to lock the file

    电脑死机,进不了桌面,实在不行就重启,但是在运行着虚拟机,重启后打开VMware虚拟机,提示failed to lock the file,进不去了,急阿,里面不少资料呢...问万能的Google,终 ...

  9. SSH 内网端口转发实战

    导读 大家都知道SSH是一种安全的传输协议,用在连接服务器上比较多.不过其实除了这个功能,它的隧道转发功能更是吸引人. 如果两个内网之间的linux服务器需要互相登录,或需要互相访问内网某个端口,担忧 ...

  10. @version ||= version

    # -*- encoding : utf-8 -*- class InterfaceBaseController < ActionController::Base private def set ...