using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public static int AllCount = 0;
int Sizes = 2;
private void show(int i,int j)
{
SqlConnection con=new SqlConnection("server=(WANGTINGJUN\\SQLEXPRESS;user id=sa;pwd=1;database=wangtingjun");
SqlDataAdapter daone=new SqlDataAdapter("select * from 个人信息",con);
DataSet dsone=new DataSet();
daone.Fill(dsone,i,j,"one");
this.dataGridView1.DataSource = dsone.Tables["one"].DefaultView;
dsone = null;
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
using (SqlConnection con = new SqlConnection("server=(WANGTINGJUN\\SQLEXPRESS;user id=sa;pwd=1;database=wangtingjun"))
{
SqlDataAdapter da = new SqlDataAdapter("select * from 个人信息", con);
DataTable dt1 = new DataTable();
da.Fill(dt1);
int i = dt1.Rows.Count;
AllCount = i;
int m = i % Sizes;
if (m == 0)
{
m = i / Sizes;
}
else
{
m = i / Sizes + 1;
}
this.label2.Text = m.ToString();
this.label5.Text = "1";
show(0, 2);
}
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.dataGridView1.Dat