如何在asp.net实体框架中使用foreach循环打印选择查询数据。 [英] how to print select query data using foreach loop in asp.net entity framework.

查看:228
本文介绍了如何在asp.net实体框架中使用foreach循环打印选择查询数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用entiy框架从数据库中选择数据。我必须从我的表中选择所有记录。现在我想使用foreach循环在每个标签或任何div中打印每个列数据。



请帮助我....

谢谢。

Hi,

I am using entiy framework to select the data from database. I have to select all records from my table. Now I want to print each column data in a each label or any div using foreach loop.

please help me....
Thank you.

推荐答案

如果你有表数据,那么将gridview控件添加到你的页面。在后面的代码中



If you have Table Data then add gridview control to your page. in the code behind

GridView1.DataSource = EFQuary.ToList();
GridView1.DataBind();


这篇关于如何在asp.net实体框架中使用foreach循环打印选择查询数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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