摘要: 【声明】本文来源于:http://blog.163.com/qqabc20082006@126/blog/static/229285252009718103810534/【阐述】在微软WinForm中,BindingNavigator控件主要用来绑定数据。可以将一个数据集合与该控件绑定,以进行数据联动的显示效果。【目标】如图下图所示:那么,下面我们就来用BindingNavigator控件做一下上图所示的效果。【方法】示例代码: Form1.csusing System;using System.Collections.Generic;using System.ComponentModel;u 阅读全文
posted @ 2013-12-17 20:52 大漠孤烟~ 阅读(1221) 评论(0) 推荐(0)
摘要: 【目标】实现DataGridView分页【结果】基本实现:1.实现分页浏览,这种方法将数据库数据全部读到内存,只是分页显示。2.实现分页读取:写存储过程,获得以当前页码和页面大小为参数,读取需要的数据并显示。【条件】了解BindingSource,BindingNavigator,DataGridView控件,会SQL语句写存储过程。【方法】1.实现分页浏览: 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using S... 阅读全文
posted @ 2013-12-17 20:18 大漠孤烟~ 阅读(915) 评论(0) 推荐(1)
摘要: 之前想实现分页功能,在网上看了下,要实现分页读取而不是分页预览,一个较好的方法是写存储过程,有一个感觉可以,不过没有试验:在存储过程中加入一个小算法,直接输入参数(页数)读取比较划算,存储过程如下C#: create procedure class_c @x int as select classId,ClassName,EntranceDate,Remark from ( --按scgrade降序排列,并按row_number() 分组 select row_number() over (order by classId ASC) as num,*from Class) --加入算法,动态获 阅读全文
posted @ 2013-12-17 17:15 大漠孤烟~ 阅读(957) 评论(0) 推荐(0)