在asp.net中使用linq [英] using linq in asp.net

查看:69
本文介绍了在asp.net中使用linq的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi

这是我的代码

hi

this is my code

DataClassesDataContext db = new DataClassesDataContext();
       var r = from k in db.dds
               select k;
       GridView1.DataSource = r.ToList();

       GridView1.DataBind();

       dd tb = (dd)r.First();
       Response.Write(tb.name);




这样,我就得到了表格的第一行.
如果我要从表中获取其他任何行,以便在哪里可以提供索引..
请告诉我...




by this i get first row of my table.
if i want any other row from my table so where i can give the index..
plse tell me...

推荐答案

NwindDataContext nw = new NwindDataContext();
       var products = from k in nw.dds
                      select k;
       gv1.DataSource = products;
       gv1.DataBind();


嗨.........
我完成了..使用skip()..
hi.........
i done .. using skip()..


这篇关于在asp.net中使用linq的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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