asp.net (c#) MySQL 大数据快速分页
aspx页:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" CssClass="b">
<asp:ListItem Value="5">5 per page</asp:ListItem>
<asp:ListItem Selected="True" Value="10">10 per page</asp:ListItem>
<asp:ListItem Value="50">50 per page</asp:ListItem>
</asp:DropDownList> --每页显示条数
<asp:Label ID="lbpageof" runat="server"></asp:Label> --显示方式
<asp:LinkButton ID="lbpre" runat="server" CommandArgument="prev" OnClick="PagerButtonClick">Previous</asp:LinkButton> --前一页
<asp:LinkButton ID="lbnext" runat="server" CommandArgument="next" OnClick="PagerButtonClick">Next</asp:LinkButton> --后一页
<asp:LinkButton ID="lbpre2" runat="server" CommandArgument="prev" OnClick="PagerButtonClick">Previous</asp:LinkButton> --前一页2
<asp:LinkButton ID="lbnext2" runat="server" CommandArgument="next" OnClick="PagerButtonClick">Next</asp:LinkButton> --后一页2
<input id="hid_CurrentIndex"
runat="server" type="hidden" /> --索引数
cs:
hid_CurrentIndex.Value = "0"; 初始化为0
首先给出_sqlStr(sql语句)
DataSet ds;
通过程序得到一个(ds)Dataset
ds = _db.GetDataSet(_sqlStr + " limit " + (Convert.ToInt64(hid_CurrentIndex.Value) * Convert.ToInt64(DropDownList1.SelectedValue)) + "," +
DropDownList1.SelectedValue); --DropDownList1.SelectedValue1的值为每页显示条数
GridView1.PageSize = 10;
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
linkbttonenableset();
private void linkbttonenableset()
{
try
{
double dblTotalRecords = Convert.ToDouble(取得总的记录行数单独写个sql_count);
相关文档:
1、登陆MySQL:
mysql -u root -p
2、查看用户信息
select user,host,password from mysql.user;
select user,host from mysql.user;
3、设置密码
set password for root@localhost=password('
在这里填入root密码
');
4、修改密码
方法1:mysqladmin -u root -p password newpassword
方法2: #mysql -u root ......
BIND-DLZ实验:http://bind-dlz.sourceforge.net/
实验环境:RHEL4,BIND-9.5.0-P2.tar.gz(9.4.0以上版本都已含DLZ补丁),Mysql-5.0.56.tar.gz
1、安装mysql(先安装gcc等相关软件包)
#tar zxvf mysql-5.0.56.tar.gz
#cd mysql-5.0.56
#./configure --prefix=/usr/local/my ......
首页:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ......
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//数据库地址
private string datapatch = "db/global.asa";//数据库地址
///
/// 取得dataset
//
/// 查询语句
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......
前提:MySQL中存在一个用户自己建立的数据库,假设为mydb,mydb中有一张用户自己建立的表格,假设名称为mytable
我的前提:MySQL中存在两个数据库,yldb和yldb2,其中yldb数据库中有一张表,名为pet
一.MYSQL的命令行模式的设置:
桌面->我的电脑->属性->环境变量->新建->
PATH=“;path\mysql\bin ......