数据集 [英] dataset

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

问题描述

我想检索第一张表的前3条记录和第2张表的最后4条记录,如何使用c#和数据集执行此操作?


任何建议都会有很大的吸引力

I want to retrieve first 3 records of first table and last 4 records of
second table, How to do this using c# and dataset?

Any suggestion would be greatly appretiated

推荐答案

如果用于sql:


string Top3 =" SELECT TOP 3 * FROM yuordatatable" ;;

SqlDataAdapter YourComm = new SqlDataAdapter(Top3,yoursqlConn);

" shine"写道:
if use to sql :

string Top3= "SELECT TOP 3 * FROM yuordatatable";
SqlDataAdapter YourComm = new SqlDataAdapter( Top3, yoursqlConn );
"shine" wrote:
我想检索第一张表的前3条记录和第二张表的最后4条记录,如何使用c#和数据集执行此操作?
<任何建议都会有很大的吸引力
I want to retrieve first 3 records of first table and last 4 records of
second table, How to do this using c# and dataset?

Any suggestion would be greatly appretiated






首次记录:


dataset.Tables [table1] .Rows [0]

dataset.Tables [table1] .Rows [1]

dataset.Tables [table1 ] .Rows [2]


最后记录:

dataset.Tables [table2] .Rows [dataset.Tables [table2] .Rows.Count-1 ]

dataset.Tables [table2] .Rows [dataset.Tables [table2] .Rows.Count-2]

dataset.Tables [table2] .Rows [dataset。表[table2] .Rows.Count-3]


注意你需要检查表中是否有超过2条记录。


欢呼,


-

Ignacio Machin,

ignacio.machin at dot.state.fl.us

佛罗里达州交通局

sh INE" < SH *** @ discussions.microsoft.com>在消息中写道

news:78 ********************************** @ microsof t.com ...
Hi,

First records:

dataset.Tables[ table1 ].Rows[0]
dataset.Tables[ table1 ].Rows[1]
dataset.Tables[ table1 ].Rows[2]

Last Records:
dataset.Tables[ table2 ].Rows[ dataset.Tables[ table2 ].Rows.Count-1]
dataset.Tables[ table2 ].Rows[ dataset.Tables[ table2 ].Rows.Count-2]
dataset.Tables[ table2 ].Rows[ dataset.Tables[ table2 ].Rows.Count-3]

Note you need to check if the tables have more than 2 records.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"shine" <sh***@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
我想检索第一个表的前3个记录和第二个表的最后4个记录,如何使用c#和数据集执行此操作?
<任何建议都会有很大的吸引力
I want to retrieve first 3 records of first table and last 4 records of
second table, How to do this using c# and dataset?

Any suggestion would be greatly appretiated



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

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