上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要: 1. 在存储过程开始时 set noucount on 结束时 set noucount off(设置nocount 为 ON 以后,只对当前链接一直有效(除非 set nocount off),对其他SQL会话无效)2.SET XACT_ABORT ON ,当 SET XACT_ABORT 为 ON 时,如果 Transact-SQL 语句产生运行时错误,整个事务将终止并回滚。为 OFF 时,只回滚产生错误的 Transact-SQL 语句,而事务将继续进行处理。编译错误(如语法错误)不受 SET XACT_ABORT 的影响。(设置XACT_ABORT 为 ON 以后,只对当前链接一直有效 阅读全文
posted @ 2011-04-01 11:30 再快一点 阅读(189) 评论(0) 推荐(0) 编辑
摘要: static void Main() { SqlParameter para = new SqlParameter("wq", 0); Console.WriteLine(para.SqlDbType);//输出BigInt, Console.WriteLine(para.Value==null);//输出true //难道new SqlParameter("wq", 0);调用的是SqlParameter(string parameterName, SqlDbType dbType)这个重载?微软的Bug? para.Value = 0; Consol 阅读全文
posted @ 2011-03-31 16:33 再快一点 阅读(160) 评论(0) 推荐(0) 编辑
摘要: class.cst内容如下:<%@ CodeTemplate Language="C#" TargetLanguage="C#" Debug="False" ResponseEncoding="utf-8"%><%@ Assembly Name="System.Windows.Forms" %><%@ Import Namespace="System.Windows.Forms" %> <script runat="temp 阅读全文
posted @ 2011-03-22 20:27 再快一点 阅读(240) 评论(0) 推荐(0) 编辑
摘要: static void Main() { Thread t1 = new Thread(Thread1); Thread t2 = new Thread(Thread2); t1.Start(); Thread.Sleep(100); t2.Start(); } static void Thread1() { Semaphore sema = new Semaphore(2, 3, "my"); sema.WaitOne(); sema.WaitOne(); Console.WriteLine("Thread1 get the Semaphore : " 阅读全文
posted @ 2011-03-21 10:55 再快一点 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1.排它锁在一个Sql连接中这样写:begin tran--select * from a with(UPDLOCK)update a set [name]='wq' where [id]=2 --这里的set的值不能不变(即不能本来name='wq'又set name='wq'),否则Sql Server会优化成不加锁waitfor delay '00:00:08'commit tran在另外一个sql连接中这样写:select * from a 发现第二个连接里的sql语句必须等到第一个连接里的事务完成才执行完成,这是因为第一 阅读全文
posted @ 2011-03-16 21:17 再快一点 阅读(4740) 评论(2) 推荐(1) 编辑
摘要: using System;using System.Threading;using System.Runtime.Remoting.Contexts;namespace ConsoleApplication4{ [Synchronization] public class MyCounter : ContextBoundObject { private int _expectedCounterVal; private int _currentCounterVal; private ManualResetEvent _event = new ManualResetEvent(false); pu 阅读全文
posted @ 2011-03-14 11:08 再快一点 阅读(680) 评论(0) 推荐(0) 编辑
摘要: import java.lang.*;import java.util.*;public class Test { public static void main(String[] str) { List arr = new ArrayList(10); List arr2 = new ArrayList(10); Why(new A()); Why(new B()); doTest(new ArrayList(123)); doTest(arr); doTest(arr2); ExecTest(arr); ExecTest(arr2); } static void Why... 阅读全文
posted @ 2011-02-26 18:49 再快一点 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 第一个例子:import java.lang.*;public class Test { public static void main(String[] str) { Fun(new MyInterface(){public void Say() { System.out.println("this is temp interface"); }}); Fun(new People(){public void Say() { System.out.println("this is temp class"); }}); } static void Fun( 阅读全文
posted @ 2011-02-23 10:18 再快一点 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 1.<?xml version="1.0" encoding="utf-8"?><books xmlns:wq="http://www.baidu.com"> <book name="海底两万里" /> <book name="鲁宾逊漂流记" /></books><books xmlns:wq="http://www.baidu.com"> 这一句只是声明了wq这个命名空间对应的URI,并没有让books和books的子元素使用此命名空间2.<?xml version="1.0" encoding="utf-8"?& 阅读全文
posted @ 2011-02-22 13:55 再快一点 阅读(2275) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Web;using System.Threading;/// <summary>/// 用于生成商品详细页的类/// </summary>public class ProductHtmlCreate{ /// <summary> /// 存储商品静态文件的文件夹路径,在Application_Start事件中被设置为磁盘的绝对路径 /// 阅读全文
posted @ 2010-12-31 18:53 再快一点 阅读(385) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页