JasonBie

2016年1月5日

查询SQLSERVER执行过的SQL记录

摘要: SELECT TOP 1000 --创建时间 QS.creation_time, --查询语句 SUBSTRING(ST.text,(QS.statement_start_offset/2)+1, ((CASE QS.statement_end_offset WHEN -1 THEN DATALEN... 阅读全文

posted @ 2016-01-05 11:07 JasonBie 阅读(432) 评论(0) 推荐(0) 编辑

2014年12月26日

Asp.net Web API 返回Json对象的两种方式

摘要: 这两种方式都是以HttpResponseMessage的形式返回,方式一:以字符串的形式var content = new StringContent("{\"FileName\": \"" + fileName + "\"}");HttpResponseMessage response = new... 阅读全文

posted @ 2014-12-26 14:45 JasonBie 阅读(1316) 评论(0) 推荐(0) 编辑

2014年3月19日

Read Excel file from C#

摘要: Common way is:var fileName = string.Format("{0}\\fileNameHere", Directory.GetCurrentDirectory());var connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=Excel 8.0;", fileName);var adapter = new OleDbDataAdapter("SELECT * F 阅读全文

posted @ 2014-03-19 18:14 JasonBie 阅读(1138) 评论(0) 推荐(0) 编辑

2013年7月12日

JavaScript测试工具比较: QUnit, Jasmine, and Mocha

摘要: 1. QUnitA JavaScript Unit Testing framework.QUnit is a powerful, easy-to-use JavaScript unit testing framework. It's used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code.Features:- Similar to server-side frameworks(JUnit, Nunit)- Built by 阅读全文

posted @ 2013-07-12 17:48 JasonBie 阅读(3639) 评论(0) 推荐(0) 编辑

2012年11月29日

Asp.net Form验证后造成URL参数重复的问题

摘要: 开发Asp.net网站, 开发网站使用Form验证, 需要在Web.config中加入如下节点<authenticationmode="Forms"><formsloginUrl="~/Public/Login"timeout="30"/></authentication>打开带有参数的页面时,如果未登录或登录已超时,会自动跳转到Login页面, 但是当输入完用户名密码后, 如果使用 this.HttpContext.Request.UrlReferrer 获取之前的页面就会发现获取到的Url中包含 阅读全文

posted @ 2012-11-29 18:20 JasonBie 阅读(482) 评论(0) 推荐(0) 编辑

2012年4月25日

MVC删除数据的方法

摘要: 一种是通过JavaScript:<scriptsrc="http://www.cnblogs.com/Scripts/MicrosoftAjax.js"type="text/javascript"></script><scripttype="text/javascript">function deleteRecord(recordId){// Perform deletevar action = "/Home/Delete/" + recordId;var request = n 阅读全文

posted @ 2012-04-25 10:37 JasonBie 阅读(1032) 评论(0) 推荐(0) 编辑

2012年4月12日

Session State

摘要: A Session State ExamplepublicclassFurniture{publicstringName;publicstringDescription;publicdecimalCost;publicFurniture(stringname,stringdescription,decimalcost){Name=name;Description=description;Cost=cost;}}publicpartialclassSessionStateExample:System.Web.UI.Page{protectedvoidPage_Load(Objectsender, 阅读全文

posted @ 2012-04-12 16:57 JasonBie 阅读(249) 评论(0) 推荐(0) 编辑

Cookie

摘要: Before you can use cookies, you should import the System.Net namespace so you can easily workwith the appropriate types:usingSystem.Net;Cookies are fairly easy to use. Both the Request and Response objects (which are provided throughPage properties) provide a Cookies collection. The important trick 阅读全文

posted @ 2012-04-12 15:24 JasonBie 阅读(153) 评论(0) 推荐(0) 编辑

Transferring Information Between Pages

摘要: Transferring Information Between PagesCorss-Page PostingHere’s an example—a page named CrossPage1.aspx that defines a form with two text boxes and a button. When the button is clicked, it posts to a page named CrossPage2.aspx.<%@PageLanguage="C#"AutoEventWireup="true"CodeFile= 阅读全文

posted @ 2012-04-12 13:58 JasonBie 阅读(247) 评论(0) 推荐(0) 编辑

View State

摘要: A View State ExamplepublicpartialclassSimpleCounter:System.Web.UI.Page{protectedvoidcmdIncrement_Click(Objectsender,EventArgse){intcounter;if(ViewState["Counter"]==null){counter=1;}else{counter=(int)ViewState["Counter"]+1;}ViewState["Counter"]=counter;lblCount.Text=&quo 阅读全文

posted @ 2012-04-12 10:42 JasonBie 阅读(160) 评论(0) 推荐(0) 编辑

导航