Linq 组合查询与分页查询
Posted 常啸森
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linq 组合查询与分页查询相关的知识,希望对你有一定的参考价值。
后台:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ZS : System.Web.UI.Page
{
Hashtable ht = new Hashtable();
int pcou = 2;
protected void Page_Load(object sender, EventArgs e)
{
Button1.Click += Button1_Click;
Button2.Click += Button2_Click;
//////////////////////////////////////////////////////////////////////
if (!IsPostBack)
{
Repeater1.DataSource = new StusData().SelectTJ(TSQL(1), ht);
Repeater1.DataBind();
//最大页数绑定
PageAll.Text = PageAAll().ToString();
////下拉菜单绑定
for (int x = 1; x <= PageAAll(); x++)
{
ListItem li = new ListItem(x.ToString(), x.ToString());
DropDownPage.Items.Add(li);
}
}
PageJump.Click += PageJump_Click;
PageNext.Click += PageNext_Click;
PageLast.Click += PageLast_Click;
PageOld.Click += PageOld_Click;
PageFirst.Click += PageFirst_Click;
Select.Click += Select_Click;
}
//拼写TSQL语句查询所有信息*****
public string TSQL(int zz)
{
ht.Clear();
int cc = 0;//记录下一条查询数据
string sql =