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);
Ïà¹ØÎĵµ£º
VB
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
MSComm1.CommPort = i1
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InBufferCount = 0
& ......
Ê×Ò³£º
<%@ 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 ......
ÕâÊÇÒ»¸öÓйطÖÒ³µÄʵÀý,½ö¹©²Î¿¼(´úÂëÀ´×ÔÍøÂç)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;
using System.Threading;
using System.Collections;
us ......
1.´´½¨±í£º
create table groupTable(dept varchar(6),phone varchar(20),amount int);
2.²åÈë²âÊÔÊý¾Ý£º
insert groupTable
select 'ÓªÒµ²¿',8001,20 union all
select 'ÓªÒµ²¿',8002,30 union all
se ......
²Ù×÷Êý¾Ý¿â
µÇ¼µ½mysqlÖУ¬È»ºóÔÚmysqlµÄÌáʾ·ûÏÂÔËÐÐÏÂÁÐÃüÁÿ¸öÃüÁîÒԷֺŽáÊø¡£
1¡¢ ÏÔʾÊý¾Ý¿âÁÐ±í¡£
show databases;
ȱʡÓÐÁ½¸öÊý¾Ý¿â£ºmysqlºÍtest¡£ mysql¿â´æ·Å×ÅmysqlµÄϵͳºÍÓû§È¨ÏÞÐÅÏ¢£¬ÎÒÃǸÄÃÜÂëºÍÐÂÔöÓû§£¬Êµ¼ÊÉϾÍÊǶÔÕâ¸ö¿â½øÐвÙ×÷¡£
2¡¢ ÏÔʾ¿âÖе ......