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游戏开发之仿仙剑奇侠传角色死亡效果实现
wp8 入门到精通 LINQ to SQL的更多相关文章
- wp8 入门到精通 虚拟标示符 设备ID
//获得设备虚拟标示符 wp8 public string GetWindowsLiveAnonymousID() { object anid = new object(); string anony ...
- wp8 入门到精通 WebClient Post
WebClient wc = new WebClient(); var URI = new Uri("http://your_uri_goes_here"); //If any e ...
- wp8 入门到精通 ---时间
DateTime.Now.ToShortTimeString()DateTime dt = DateTime.Now;dt.ToString();//2005-11-5 13:21:25dt.ToFi ...
- wp8 入门到精通 仿美拍评论黑白列表思路
static bool isbool = false; private void BindGameDelete() { Tile tile = new Tile(); List<Color> ...
- wp8 入门到精通 生命周期
- wp8 入门到精通 定时更新瓷贴
public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Disp ...
- wp8 入门到精通 ImageCompress 图片压缩
//实例化选择器 PhotoChooserTask photoChooserTask = new PhotoChooserTask(); BitmapImage bimg; int newPixelW ...
- wp8 入门到精通 Gallery
<Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.Resources> ...
- wp8 入门到精通 MultiMsgPrompt
List<NotifyMsg> arraymsg = new List<NotifyMsg>(); List<NotifyInfo> ArrayNotifyInfo ...
随机推荐
- 基于REST架构的Web Service设计
来自: http://www.williamlong.info/archives/1728.html 先前我曾经介绍过利用Apache Axis实现基于SOAP的Web Service实现技术和相关代 ...
- c# 解析JSON的几种办法(转载)
对比 .NET下几种常见的解析JSON方法 主要类 命名空间 限制 内建LINQ支持 DataContractJsonSerializer System.Runtime.Serialization.J ...
- mingw32-g++.exe: *: No such file or directory错误解决方法
初次使用CodeBlocks,好不容易把环境配好, 编译没有错误了,但是程序并不生成exe,提示以下问题: mingw32-g++.exe: /W3: No such file or director ...
- JAVA本地方法详解,什么是JAVA本地方法?
一. 什么是Native Method 简单地讲,一个Native Method就是一个java调用非java代码的接口.一个Native Method是这样一个java的方法:该方法的实现由非j ...
- gdb 多线程调试
gdb 多线程调试 http://hi.baidu.com/hcq11/blog/item/9f5bfc6e696209d680cb4a25.html http://hi.baidu.com/lit ...
- 各种工具使用手册:http://www.itshouce.com.cn/linux/linux-tcpdump.html 关于tcpdump!!!!
各种工具使用手册:http://www.itshouce.com.cn/linux/linux-tcpdump.html 关于tcpdump!!!! 实用tcpdump命令 //查看本机与mysql的 ...
- XSS 探索
1. 什么是XSS攻击? 正常的页面被渗出了攻击者的js脚本,这些脚本可以非法地获取用户信息,然后将信息发送到attacked的服务端. XSS是需要充分利用输出环境来构造攻击脚本的 2. 危害 非法 ...
- cocos进阶教程(2)多分辨率支持策略和原理
cocos2d-x3.0API常用接口 Director::getInstance()->getOpenGLView()->setDesignResolutionSize() //设计分辨 ...
- [Effective JavaScript 笔记] 第14条:当心命名函数表达式笨拙的作用域
js函数会根据上下文改变其含义. function double(x){return x*2;} 这是一个函数声明,也可以是一个命名函数表达式(named function expression),取 ...
- [Effective JavaScript 笔记]第3章:使用函数--个人总结
前言 这一章把平时会用到,但不会深究的知识点,分开细化地讲解了.里面很多内容在高3等基础内容里,也有很多讲到.但由于本身书籍的篇幅较大,很容易忽视对应的小知识点.这章里的许多小提示都很有帮助,特别是在 ...