在列表视图中显示记录 [英] Show record in list view

查看:73
本文介绍了在列表视图中显示记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在列表视图中显示默认学生(本月没有支付费用)。我在数据库中有两个表,一个包含学生记录,另一个包含他们的费用记录。你能告诉我如何编写查询来解决我的问题..任何帮助将不胜感激。

i want to show defaulter students(who have not paid fees of this month) in list view. I have two tables in database one contains student record and other contains their fee record. Can you please tell me how to write query to solve my problem.. any help would be appreciated.

推荐答案

使用Ado.net代码实现此功能





Make this function with Ado.net code


public DataTable selectstudent() 
        {
            com.Connection = con;
             con.Open();
            com.CommandText = "select StudentId,StudentName,StudentFees from Student inner join  Fees on student.StudentId=fees.StudentId Where StudentFees=0";

            com.CommandType=CommandType.Text;
            SqlDataReader sdr= com.ExecuteReader();
            DataTable dt=new DataTable();
            dt.Load(sdr);
            con.Close();
            return dt;

        }





然后..


加载表格中的




制作包含该功能的类别的对象

和..
< br $>




Then..

in The Load Form

make An object With The Class Which Contain The Function
And..


DataTable Dt=ClassObject.selectstudent();
ListView.DataSource=Dt;


这篇关于在列表视图中显示记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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