using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
- string str = “select * from Table1 where id between “+pageIndex+” and “+PageSize;
- da = new SqlDataAdapter(str,con);
- ds = new DataSet();
- da.Fill(ds);
- dt = ds.Tables[0];
- bi.DataSource = dt;
- dataGridView1.DataSource = bi;
- dataGridView1.ClearSelection();
}
}
}