随笔分类 -  经验总结

Asp.Net 使用jquery json,注意后台返回的内容。
摘要:后台代码/// <summary> /// CommonHandler 的摘要说明 /// </summary> public class CommonHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.Expires = -1; context.Response.ContentType = "text/plain"; if (string.Equals((context.Request["ajaxmethod 阅读全文

posted @ 2012-04-27 15:45 jianshaohui 阅读(141) 评论(0) 推荐(0)

File,FileStream,byte[]3者互相转换总结
摘要:File>>>FileStream (2种方式)方式1:FileStream fs1 = File.Open ( @"D:\集团通知.jpg" , FileMode.Open );方式2:FileStream fs2 = new FileStream ( @"D:\通知.jpg" , FileMode.Open );FileStream>>>byte[]byte [ ] b1 = new byte [ fs1.Length ];fs1.Read ( b1 , 0 , b1.Length );把文件保存到数据库中一般是F 阅读全文

posted @ 2011-05-18 09:35 jianshaohui 阅读(382) 评论(1) 推荐(0)

asp.net 调用excel
摘要:Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.中文翻译为:检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 800700051:在服务器上安装office的Excel软件.2:在”开始”->”运行”中输入dcomcnfg.exe启动”组件服务”3:依次双 阅读全文

posted @ 2011-05-10 20:19 jianshaohui 阅读(309) 评论(0) 推荐(0)

2005 打开 2010 项目经验总结
摘要:下面是网上的直接复制粘贴:网址为http://hi.baidu.com/zealot886/blog/item/7364d4266a2a1555ac34dea6.html/cmtid/65ff140a660e02246159f3db这里是我自己的总结(1、用vs2010 将该解决方案的所有 项目都改为 net 2.0(方法,右击项目=》属性=》应用程序=》目标框架=》选择net 2.0)2、如果是web项目(与web网站不一样),则需要安装2005补丁(VS80sp1-KB926601-X86-ENU.exe),然后用记事本打开 该网站项目的 *.csproj 文件。查找Import文本,将下 阅读全文

posted @ 2011-04-18 16:03 jianshaohui 阅读(2906) 评论(0) 推荐(0)

sql精点语句
摘要:1.查询语句的字符相加select ','+isnull(bossnum,'') from dbo.atestfor xml path('')2.使用模式分割字符串declare @s varchar(1000)set @s=N'1AAAA2可以了嗎BBBBB3CCCC23698好的adadasd.,,'declare @t table(ID int ,[name] varchar(100))while patindex('%[0-9]%',@s)>0 begin declare @ID varchar(10 阅读全文

posted @ 2011-03-18 14:55 jianshaohui 阅读(426) 评论(2) 推荐(0)

PIVOT 与 UNPIVOT
摘要:语法:SELECT <非透视的列>,[第一个透视的列] AS <列名称>,[第二个透视的列] AS <列名称>,...[最后一个透视的列] AS <列名称>,FROM(<生成数据的 SELECT 查询>)AS <源查询的别名>PIVOT(<聚合函数>(<要聚合的列>)FOR[<包含要成为列标题的值的列>]IN ( [第一个透视的列], [第二个透视的列],... [最后一个透视的列])) AS <透视表的别名><可选的 ORDER BY 子句>;代码:create 阅读全文

posted @ 2011-03-12 22:56 jianshaohui 阅读(268) 评论(0) 推荐(0)

事件触发顺序
摘要:Master页面子控件的初始化:先初始化Master页面包含的所有服务器控件。内容页面子控件的初始化:先初始化内容页面包含的所有服务器控件。Master页面的初始化:初始化Master页面内容页面的初始化:初始化内容页面内容页面的加载:加载内容页面(这是Page_Load事件,后跟Page_LoadComplete事件)Master页面的加载:加载Master页面(这也是Page_Load事件,后跟Page_LoadComplete事件)Master页面子控件的加载:把Master页面中的服务器控件加载到页面中内容页面子控件的加载:把内容页面中的服务器控件加载到页面中在建立应用程序时应该注意这 阅读全文

posted @ 2011-03-05 15:18 jianshaohui 阅读(510) 评论(0) 推荐(1)

javascript 动态添加事件
摘要:目前的的页面布局都是基于XHTML,通过DIV+CSS布局,实现DHTML的样式。所以这个JavaScript动态的为元素添加事件因此而普遍了。下面我说说怎样通过javascript为元素动态的添加事件.Javascript为元素动态的添加事件包括两种情况:不带参数的事件和带参数的事件。一、不带参数的事件:两种方式:直接给对象添加事件,节点添加事件例如给一个id为tab1的添加onclick事件第一种情况:var t = document.getElementById("NewTitle");t.onclick = function showmsg(){ alert( 阅读全文

posted @ 2011-03-02 00:24 jianshaohui 阅读(466) 评论(0) 推荐(1)

xml 与 Repeater层次绑定
摘要:<table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td id="Main_tdLeftMenu" width="180" valign="top" style="display: block;"> <div id="CPHMiddle_body_menu"> <div cla 阅读全文

posted @ 2011-03-01 11:13 jianshaohui 阅读(253) 评论(0) 推荐(1)

iframe 的水平滚动条
摘要:iframe问题2008-01-2216:37******显示iframe内容 XHTML1.0Transitional标准不能显示 <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> 父页面:修改为 HTML4.01Transitional标准 &l 阅读全文

posted @ 2011-02-23 11:21 jianshaohui 阅读(23149) 评论(0) 推荐(1)

注册用户控件
摘要:“assembly” 是dll的名称“namespace” 是命名空间 “tagprefix”在页面里的名字,比如页面里放一个 文本框,asp:textbox … 那么这里的asp 就是tagprefix 。tagprefix="FCKeditorV2" 那么就是 FCKeditorV2:控件的类名 %@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %%@ Register assembly="GMDatePicker" namespa 阅读全文

posted @ 2011-02-08 14:30 jianshaohui 阅读(274) 评论(0) 推荐(1)

Global.asax 文件说明
摘要:在网上找了N多相关的东西总说的不够细,现在终于找到了.可以了解web.cofig和Global.asax之间的关系以及执行的顺序.在Global.asax.cs文件中protected void Application_BeginRequest(Object sender, EventArgs e){ Application["StartTime"] = System.DateTime.Now; }再在webform1中的page_load事件中添加private void Page_Load(object sender, System.EventArgs e) { System.Date 阅读全文

posted @ 2011-02-03 00:46 jianshaohui 阅读(2563) 评论(0) 推荐(0)

sql 游标简单使用(判断临时表是否存在)
摘要:IF OBJECT_ID('tempdb..#tmp') IS NOT NULL DROP TABLE #tmpselect * into #tmp from (select ('select * from ' +name) as 'name' from sysobjects where xtype='U') qdeclare @id nvarchar(200) --定义变量来保存ID号declare mycursor cursor for select * from #tmp --为所获得的数据集指定游标open mycursor --打开游标fetch next from mycursor 阅读全文

posted @ 2011-01-27 21:39 jianshaohui 阅读(615) 评论(0) 推荐(0)

asp.net 文件下载与压缩
摘要:1.添加ICSharpCode.SharpZipLib.dll(该组件是压缩组件)2.添加一个压缩辅助类,可以压缩多个文件using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using ICSharpCode.SharpZipLib.Zip;using ICSharpCode.SharpZipLib.Checksums;namespace CSharpZipLibHelper{ public class SharpZipLibHelper { // 阅读全文

posted @ 2010-12-13 09:14 jianshaohui 阅读(1142) 评论(4) 推荐(1)

js 模态窗口 以及返回值
摘要:给你参考一下, JS兼容就可以实现了, 最重要的内容我已经用红色标出:IE 与 FireFox 的 showModalDialog 在网页程序中,有时我们会希望使用者按下按钮后开启一个保持在原窗口前方的子窗口,而在IE中,我们可以使用showModalDialog来达成,语法如下 : vReturnValue = window.showModalDialog(sURL [, vArguments]... 阅读全文

posted @ 2010-11-26 15:11 jianshaohui 阅读(7528) 评论(0) 推荐(0)

Xpath 小见
摘要:?xml version="1.0" encoding="utf-8" ?books book titlec#入门经典/title price79.00/price authorms/author /book book title id="Best"c#高级编程/title price128.00/price authorms/author /book book title type="构架"大话设计模式/title price55.00/price author中国/author /book 阅读全文

posted @ 2010-11-17 23:40 jianshaohui 阅读(195) 评论(1) 推荐(0)

c# 操作xml (非linq版本)
摘要:<?xml version="1.0" encoding="UTF-8"?><books> <book> <name>哈里波特</name> <price>10</price> <memo>这是一本很好看的书。</memo> </book> <book id="B02"&g... 阅读全文

posted @ 2010-11-15 17:41 jianshaohui 阅读(176) 评论(0) 推荐(0)

创建分区
摘要:【IT专家网独家】你是否在千方百计优化SQL Server 数据库的性能?如果你的数据库中含有大量的表格,把这些表格分区放入独立的文件组可能会让你受益匪浅。SQL Server 2005引入的表分区技术,让用户能够把数据分散存放到不同的物理磁盘中,提高这些磁盘的并行处理性能以优化查询性能。  SQL Server数据库表分区操作过程由三个步骤组成:  1. 创建分区函数  2. 创建分区架构  3... 阅读全文

posted @ 2010-11-02 23:41 jianshaohui 阅读(322) 评论(0) 推荐(0)

创建分区表
摘要:-- 创建分区函数 create partition function PF_Orders_OrderDateRange(datetime) as range right for values ( '1997-01-01', '1998-01-01', '1999-01-01' ) go -- 创建分区方案create partition scheme PS_Orders as partition... 阅读全文

posted @ 2010-11-02 23:40 jianshaohui 阅读(369) 评论(0) 推荐(0)

access 小结
摘要:1.分页过程SELECT top 2 * from Contactwhere id>(select max(id) from ( select top 8 id from contact order by id asc))order by id asc 阅读全文

posted @ 2010-10-30 00:07 jianshaohui 阅读(128) 评论(0) 推荐(0)

导航