摘要: 1.SQL中的分页存诸过程CREATE PROCEDURE GetDataByPager2( @startIndex INT,--起始记录数,从0开始 @tableName VARCHAR(50), --表名 @pageSize INT=5, --显示的条数 @condition VARCHAR(1000)='1=1', --where语句的条件部分 @key VARCHAR(20)='id', --主建列名 @orderType VARCHAR(20)='desc' --排序方式)ASBEGIN DECLARE @TopCount IN... 阅读全文
posted @ 2012-06-04 13:04 酒沉吟 阅读(570) 评论(0) 推荐(0)
摘要: 1.WS须支持可序列化的对象,对泛型 支持不够 2.WS的发部 : 先 生成网站,再 发部网站。 以下是WS的一些代码using System;using System.Linq;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Xml.Linq;using System.Collections.Generic;using System.Data;using System.Data.SqlClient;[System.Web.Script.Services.S. 阅读全文
posted @ 2012-05-25 15:38 酒沉吟 阅读(347) 评论(0) 推荐(0)
摘要: ***********特别注意用户信息存在session中在其他页面的取值方法 ThreeTies.Model.User u= Session["User"] as ThreeTies.Model.User; labUserName=u.UserName; labUserPwd=u.UserPwd;1.通用类层的代码using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;nam 阅读全文
posted @ 2012-05-09 21:36 酒沉吟 阅读(369) 评论(0) 推荐(1)
摘要: 1. 在Web.config文件中数据库连接字符串的运用 a.将web.config文件中<system.web>标签之上的<connectionStrings />更改如下: <connectionStrings> <add name="ConnStr" connectionString="Data Source=.;Initial Catalog=YGG;Integrated Security=True" /> </connectionStrings> b.在后台防问时数据库连接串的写法 s 阅读全文
posted @ 2012-04-25 21:55 酒沉吟 阅读(312) 评论(0) 推荐(0)
摘要: 缓存分为页面缓程和应用程序缓存1.页面缓存 。整页缓存 <%@OutputCache Duration="5" VaryByParam="none" %> *缓存标记 * 缓存周期时间 *缓存改变的条件 <%@ OutputCache Duration="30" VaryByControl="DropDownList1" %> *表示随着DropDownList1值的变化而变化 <%@ OutputCache Duration="5" Var... 阅读全文
posted @ 2012-04-25 13:55 酒沉吟 阅读(160) 评论(0) 推荐(0)
摘要: 1.在项目中添加一个 “ 一般处理程序” 2.在web.config配置文件的<system.web>标记下的<httpHandlers><httpHandlers/>内添中如下标记 <add verb="*" path="image/map/*.jpg" type="Handler" /> *所有请求 请求Paht路径下.jpg图片时 用Handler处理3.添加App_Code文件夹,在其内添加一个类,将 “一般处理程序” 中除头标签外的所有代码复制到该类中 (因为程序只能识别在Ap 阅读全文
posted @ 2012-04-24 16:50 酒沉吟 阅读(284) 评论(0) 推荐(0)
摘要: 1.套用别人的CSS 新建一个样式表!将其<style type="text/css">内的代码 复制到该样式表body { font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0; font-size: 80%; font-weight: bold; background: #F3FAFF; }ul { list-style: none; margin: 0; padding: 0; }/* =-=-=-=-=-=-=-[Menu One]-=-=-=-=-=-=-=- */#menu... 阅读全文
posted @ 2012-04-22 23:19 酒沉吟 阅读(254) 评论(0) 推荐(0)
摘要: 为GridView绑定主键的方法,在前台的DataGrid标签中加 DataKeyNames="ID" 后台获取ID: int id=int.parse(this.GridView.DataKeys[e.RowIndex].Value.Tostring());如果DataKeyNames绑定了多个列取法:int id=int.parse(this.GridView.DataKeys[e.RowIndex].Value["ID"].Tostring());*****注意GridView在执行添删改时如果是提交性质按钮一定会触发GridView_RowCom 阅读全文
posted @ 2012-04-21 22:11 酒沉吟 阅读(466) 评论(0) 推荐(0)
摘要: 1.使用DropDownList手动绑定数据源 public void GetBinds() { DataTable tb= GetTable(……); this.DropDownList.DataSource=tb; this.DropDownList.DataTextField="类别"; //可见值 this.DropDownList.DataValueField="ID" //隐藏值 } 调用该 方法后记的 加上 this.DataBind();2. 篇历的 ChickBoxList for (int i=... 阅读全文
posted @ 2012-04-16 13:25 酒沉吟 阅读(205) 评论(0) 推荐(0)
摘要: 1. 绑定标签 <%# …… %> 可绑定标签属性值,表达式,方法的结果及数据源等。 a. 绑定属性之label的Text属性值 : <asp: label1 ID="labtxt" Text="<%# DataTime.Now.ToShortString() %>" > this.label1.DataBind();***************后台代码千万不能少 b.绑定变量 后台代码类中定义一变量 protected Color bgcolor=Color.FromArgb(180,140,210); 前台 &l 阅读全文
posted @ 2012-04-16 09:50 酒沉吟 阅读(189) 评论(0) 推荐(0)