public partial class xiaoshouchaxun : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Server.Execute("Judge.aspx");
}
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
this.GridView1.PageIndex = e.NewSelectedIndex;
query();
}
public void query()
{
string sql_query = "select * from JiaoYi where 交易类型='销售'";
SqlConnection cn = DB.createCon();
SqlCommand cmd = new SqlCommand(sql_query, cn);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
cn.Open();
sda.Fill(ds, "JiaoYi");
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.DataBind();
cn.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
query();
}