自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(52)
  • 收藏
  • 关注

原创 update from

update一般用来更新一个表中的字段。update from可以用表1的B字段的值去更新表2的B字段,例如:update test2 set b=y.b from test2 x,test1 y where x.a=b.a

2010-10-25 13:59:52 700

http://www.niunan.org/show.php?id=265

create PROCEDURE [dbo].[proc_ShowPage] @tblName varchar(255), -- 表名 @strGetFields varchar(1000) = '*', -- 需要返回的列,默认* @strOrder varchar(255)='', -- 排序的字段名,必填 @strOrderType varc...

2010-05-03 11:07:42 534

mssql有用的函数

随机数;select right(newid(),10)绝对值(也就是没有出现负数)select abs(-0.99) 比如 1.000003 他就是取2 对于- 1.000003 就取-1select ceiling(num) from category比如 1.000003 他就是取1 对于- 1.000003 就取-2select floor(num) from...

2010-04-29 21:21:31 130

post传值 and get传值

<title>登录页面</title></head><body>    <form id="form1" runat="server" method="post" action="index.aspx">    <div>        <asp:T

2009-09-19 15:16:48 148

原创 http://sofewater-in-sky.javaeye.com/blog/267137

--返回表的字段名称 select name from syscolumns where id=object_id('jobs') --刚看到的.新建一个与a表一样的空的b表 select * into b from a where 1<>1 一些不错的sql语句,自己根据需要收藏吧,分给多点哦:) 1、说明:复制表(只复制结构,源表名:a 新表名:b) (Access可用) 法一:s...

2009-08-23 14:51:30 1848

GridView背景隔行换色和鼠标移上去换色?

鼠标移上去换色?用jquery去实现; $(".delete_link").parent().parent().mouseover(function(){                   $(this).css("backgroundColor","#cccccc");                    }) .mouseout(function(){               ...

2009-08-20 23:25:16 137

execl导入用sql导入到数据库中!!!!!

INSERT INTO mobile(number,Charges,category,Price) SELECT number,Charges,category,Price FROM OPENROWSET('MICROSOFT.JET.OLEDB.4.0','Excel 5.0;HDR=YES;DATABASE=E:\Book1.xls',sheet1$)

2009-08-19 20:00:15 92

上传下载文件

 protected void Button1_Click(object sender, EventArgs e)    {        //PostedFile获取要上传文件的信息        if (this.files.PostedFile.FileName.Length == 0)        {            Page.ClientScript.RegisterStartu...

2009-08-13 23:14:39 67

发送电子邮件

 protected void Button1_Click(object sender, EventArgs e)    {        string from = txtform.Text;        string to = Txtto.Text;        string subject = Txtsubject.Text;        string body = txtbody.T...

2009-08-13 22:57:28 129

GridView取得id

  gvlist.DataKeyNames = new string[] { "id"};            gvlist.DataBind(); int ids =int.Parse( gvlist.DataKeys[e.RowIndex].Value.ToString()); 

2009-08-13 22:17:30 141

GridView去掉多余的废嘛

  GridView1中的属性EnableViewState="true"  protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)        {            if (e.Row.RowType==DataControlRowType.DataRow )            {...

2009-08-13 22:15:29 88

原创 网页上应用qq登录程序

          <div id="">          咨询QQ:<span><a target="_blank" href="http://wpa.qq.com/msgrd?V=1&Uin=6192278">               <img alt="点击这里给我发消息" src="h

2009-06-22 21:54:24 157

MD5 的摘要说明

/// <summary>///MD5 的摘要说明/// </summary>public static class MD5{    public  static string GetMD5(string Input, bool Half)    {        string output = System.Web.Security.FormsAuthentication...

2009-06-07 15:57:03 153

迁移数据库中的表的数据

go use Eglobalpurchase go select * into ego.dbo.PurchaserList from PurchaserList go说明一下:go use 原数据库名go select * into 目的数据库名.dbo.目的表名 from 原表名 go

2009-06-02 10:26:28 110

XML增删改查

//增加节点;  protected void Button1_Click(object sender, EventArgs e)    {        XmlDocument xdoc = new XmlDocument();        string mappath = Server.MapPath("xml/bolgbooks.xml");        xdoc.Load(ma...

2009-06-01 17:26:52 137

验证电子邮件

验证电子邮件输入是否正确    用户名+@+主机名  用户名的判断标准; 1 用户名允许出现数字.字母,点号,横线,下划线.2 点号,横线,下划线.不可联系出现(点号,横线,下划线两端必须出现数字,字符串)3用户名必须以数字,或字母开头,以数字,字母结束.普通字符+(特殊字符+普通字符)*[0-9a-zA-Z] +(+表示出现一次以上)([-_.][...

2009-05-29 21:19:53 290

验证手机号码

判断用户输入的手机号码是否正确! 要求: 1  手机号必须全部是数字字符串; 2  以0开头的有12位,否则有11位 3  必须覆盖移动和联通的所有号段,对15x 号段的x处理(0,3,6,8,9)  13x 的x不做限制 4  最后8不做限定; ^0?1(3\\d|5[03689])\\d{8}$" ?问号是量词 表示0可能出现一次,也可能...

2009-05-29 16:49:53 203

正则表达式验证邮政编码

正则表达式验证邮政编码:   "^\\d{6}$" 1. 要求字符串的长度必须的6位数;   {6} 2. 每个字符串必须是数字; (0-9) \\d  

2009-05-29 16:18:52 1512

正则表达式总结!!!

1排出行字符组;作用:规定某个位置不允许出现的字符;比如: [^...]方括号中不能出现的字符;注意;[^]不能排除空字符;2字符串简记法;作用是:方便他们的的使用;\d =[0-9]\D=[^0-9]\w=[0-9a-zA-Z_]\W=[^0-9a-zA-Z_]\s=匹配空白符(回车,换行,制表,空格)\S=非匹配空白符(回车,换行,制表,空格)3特殊的简记fa. 好可以...

2009-05-27 21:03:07 77

正则表达式资料

1排出行字符组;作用:规定某个位置不允许出现的字符;比如: [^...]方括号中不能出现的字符;注意;[^]不能排除空字符;2字符串简记法;作用是:方便他们的的使用;\d =[0-9]\D=[^0-9]\w=[0-9a-zA-Z_]\W=[^0-9a-zA-Z_]\s=匹配空白符(回车,换行,制表,空格)\S=非匹配空白符(回车,换行,制表,空格)3特殊的简记fa. 好可以...

2009-05-27 14:39:51 95

验证控件

CompareValidator 是比较验证控件; 比如验证密码 密码,确认密码;RegularExpressionValidator 正则表达式验证控件; 比如比如说是验证电子邮箱RangeValidator 范围验证控件;  比如说是 18-55年龄的验证;...

2009-05-20 22:42:56 101

原创 点击修改是显示类别名称,标题和内容

                //显示标题和内容                string newsid=Request.QueryString["newsid"];                newsModel n = new NewsBLL().SelectNew(newsid);                txttitle.Text = n.Title;             ...

2009-05-18 15:20:25 160

设置根据Session的值显示或隐藏删除评论的按钮

  //设置根据Session的值显示或隐藏删除评论的按钮    protected void repComment_ItemDataBound(object sender, RepeaterItemEventArgs e)    {        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType...

2009-05-17 22:11:12 150

GridView没有数据是可以设置EmptyDataText属性

EmptyDataText="该类别下暂无新闻"

2009-05-16 16:24:24 214

Givdviw要去掉表格

Givdviw要去掉表格 把 gridlines属性设置为none;

2009-05-15 23:24:42 69

添加新闻及判断验证码的问题

#region 添加评论           /// <summary>      /// 添加评论      /// </summary>      /// <param name="c"></param>      /// <returns></returns>      public bool Insert(Comm

2009-05-15 23:09:08 125

验证码问题

<%@ WebHandler Language="C#" Class="WaterMark" %>using System;   using System.Web;   using System.Drawing;   using System.Drawing.Drawing2D;   using System.Web.SessionState;       public class...

2009-05-15 15:53:49 163

删除评论

#region 删除评论            /// <summary>      /// 删除评论      /// </summary>      /// <param name="id"></param>      /// <returns></returns>      public bool Delete(st

2009-05-15 14:38:30 507

取出新闻标题.内容.时间的代码!

      public newsModel SelectNew(string id)      {          newsModel nm = new newsModel();          DataTable dt = new DataTable();          string sql = "SelectNew";          SqlParameter[] para = n...

2009-05-15 11:33:52 232

根据类别id取出新闻的内容;

ALTER PROCEDURE [dbo].[SelectBycaidList]@id intASBEGINselect  n.id,[name],title,createtime,n.caid from news n join category c on n.caid=c.id and n.caid=@idorder by createtime descEND 

2009-05-14 21:09:51 225

按标题或内容搜索

 //搜索按钮    protected void Ibtnsearch_Click(object sender, ImageClickEventArgs e)    {        string key = Textkey.Text.Trim();        string action = Radtitle.Checked ? "bytitle" : "byconent";        ...

2009-05-14 21:07:05 332

根据内容取出新闻的内容

CREATE PROCEDURE Selectbycontent@content varchar(100)ASBEGINselect c.id,[name],title,createtime,caid from news n join category c on n.caid=c.idwhere n.content like '%'+@content+'%'order by createtime ...

2009-05-14 20:50:48 107

SQLHelper类

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;using System.Configuration;namespace DAL{    public class SQLhepler   ...

2009-05-11 17:42:32 79

FileUpload上传图片

 protected void Button1_Click(object sender, EventArgs e)    {        bool Files = false;        //判断文件的类型是否符合要求        if(this .FileUpload1.HasFile)        {            //获取删除文件的后缀            string ...

2009-05-11 00:46:42 109

调用js做网站公告

<marquee direction="up" width="147px" scrollamount="3" onmouseover="this.stop()" height="75px" onmouseout="this.start()" >                <asp:Label ID="lblBulletin"

2009-05-10 22:08:16 121

原创 NET在后置代码中输入JS提示语句(背景不会变白)

Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('加入暂存架成功!');</script>");  

2009-05-10 22:07:08 73

原创 .NET截取指定长度汉字超出部分以...代替

.NET截取指定长度汉字超出部分以...代替///   <summary>       ///   将指定字符串按指定长度进行剪切,       ///   </summary>       ///   <param   name= "oldStr "> 需要截断的字符串 </param>       ///   <param   name...

2009-05-10 22:06:00 102

把密码转为md5的形式

using System.Web.Security;      protected void Page_Load(object sender, EventArgs e)    {        Response.Write("123的MD吗是" + FormsAuthentication.HashPasswordForStoringInConfigFile("123","MD5"));    }...

2009-05-10 22:03:50 722

GridView生成的HTML代码

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" CssClass="tablecss">         <Columns>             <asp:TemplateField HeaderText="编号" HeaderStyle-

2009-05-10 22:01:23 79

DropDownList的绑定

  if (!Page.IsPostBack)            {                DataTable dt = new CategoryManager().SeleteAll();                ddlCategory.DataSource = dt;                ddlCategory.DataTextField = "name";    ...

2009-05-10 21:59:16 101

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除