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 ...
随机推荐
- Eigenvectors and eigenvalues
http://setosa.io/ev/eigenvectors-and-eigenvalues/ Explained Visually Tweet By Victor Powell and Lew ...
- 转载大神的检测网站重定向的python脚本
#!/usr/bin/env python #coding=utf8 import sys import requests def check_for_redirects(url): try: r = ...
- 将对象转为数组方法:延伸array_map函数在PHP类中调用内部方法
public static function objectToArray($d) { if (is_object($d)) { $d = get_object_vars($d); } if (is_a ...
- sprintf()函数的用法
sprintf(g_strAppName, "%s",pLast+1); ----------------------------------------------------- ...
- c# params
每个C#函数都允许有个参数带params关键字,在调用的时候可以不给他传值,也可以给他传值,还可以给他传多个值,例子如下: using System; using System.Collections ...
- zhx and contest (枚举 + dfs)
zhx and contest Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
- 表单元素的写法及与后台php的交互
1.<select class="textEnaSty" name="Port" size="1" onchange="Ob ...
- ReactiveCocoa入门教程:第一部分
http://www.cocoachina.com/ios/20150123/10994.html 本文翻译自RayWenderlich,原文:ReactiveCocoa Tutorial--The ...
- python-twisted
环境:win7 64位,python 2.7.3 安装: http://twistedmatrix.com/Releases/Twisted/14.0/Twisted-14.0.0.win-amd64 ...
- CentOS6.5以runlevel 3开机时自动连接某无线设置示例
[参考]http://blog.csdn.net/simeone18/article/details/8580592 [方法一] 假设无线网卡代号为wlan0,无线AP的essid为:TheWiFi, ...