查询linq到sql中的连续数据 [英] query for continuous data in linq to sql

查看:102
本文介绍了查询linq到sql中的连续数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写一个查询,一次从我的SQL服务器数据库获取10个值,第一次需要1到10个值,而下次需要2到11 ...而不是3到12 ..这样就可以在LINQ to SQL格式中绘制用于Windows Phone 8应用程序(C#)的ECG连续图...以及用于C#中的Web应用程序的ADO.Net(SQL查询)的相同查询。

结构表是:

i need to write a query that take 10 values from my SQL server databse at a time in a way that it takes 1 to 10 values first time than next time it takes 2 to 11.. than 3 to 12.. and so on to plot ECG continuous Graph for windows phone 8 application (C#).. in LINQ to SQL format.. and also same query for ADO.Net (SQL query) for web application in C#
Structure of Table is:

Create table ECG
(
Reading_ID int IDENTITY(1,1) not null CONSTRAINT id PRIMARY KEY,
Date_Time datetime not null default CURRENT_TIMESTAMP,
Value nvarchar(10) not null
)

推荐答案

var results  = ECGs.OederBy(e=>e.Reading_ID).Skip(x).Take(y);



你可以开始当x = 0且y = 10且每次迭代将x增加一个


you can start with x=0 and y =10 and each iteration increase x by one


这篇关于查询linq到sql中的连续数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆