Installing AppLocale in Windows 7 You can get it in : http://www.microsoft.com/download/en/confirmation.aspx?id=13209 Had a similar problem, could not get it to run using the cmd.exe I did get it to work by right clicking the msi file and clicking troubleshoot compatibility, which returned with something about skipping a version check. Once that was set, it installed without a problem. http://blog.wentoday.com/?p=136… Read More
How to format datetime & date in Sql Server 2005 How to format datetime & date in Sql Server 2005 June 11, 2009 — Anubhav Goyal Execute the following Microsoft SQL Server T-SQL datetime and date formatting scripts in Management Studio Query Editor to demonstrate the multitude of temporal data formats available in SQL Server. First we start with the conversion options available for sql… Read More
SQL Server 2008 Date Format One of the most frequently asked questions in SQL Server forums is how to format a datetime value or column into a specific date format. Here’s a summary of the different date formats that come standard in SQL Server as part of the CONVERT function. Following the standard date formats are some extended date formats… Read More
about SET IDENTITY_INSERT(Sqlserver 2008) SET IDENTITY_INSERT [Table] ON|OFF 注意一次只能有一个Table能在On的状态!要及时关闭!… Read More
Comparison of issue-tracking systems 我感觉http://www.mantisbt.org/很不错呢。 http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems … Read More
C# 线程资源同步方式总结 在现代的程序开发中,资源的同步是一个比较重要的课题,在.Net中,对这部分有很丰富类库供我们使用,现在总结一下在各种情况下对资源同步的 机制。 1.将字段声明为volatile 当一个字段被声明为volatile时,CLR中一些管理代码和内存的内部机制将负责对字段进行同步,并且总能保证读取到的字段信息都为最新的值,被声明为 volatile的字段必须具备以下特征之一 1.为引用类型 2.一个指针(在不安全代码中) 3.sbyte,byte,short,ushort,int,uint,char,float,bool 4.一个使用底层类型的枚举类型 2.使用System.Threading.Interlocked 类 在许多增对整数的操作中,我们都比较容易忽视线程的问题,例如执行下列代码 i = i + 1; 实际上,上述代码分为3步骤 1). 从内存中,读取i的值 2). 将读取出来的值加1 3). 将新的值写入内存中 在单线程上,这个操作不会有任何问题,但是当i被多个线程访问时,问题就出现了,对i进行修改的线程,在上述的任何一部都有可能被其它读取线程打断,想象一下, 当操作线程执行完第二步,准备将新的值写入内存中时,此时其它读取线程获得了执行权,这时读取到的i的值并不是我们想要的,因此,这个操作不具备原子性,在.Net中,使用Interlocked类能确保操作的原子性,Interlocked类有以下的方法 Increment Decrement Exchange 上述的方法的参数都为带ref 标识的参数,因此我们说,这些方法保证了数据的原子性,在多线程中,涉及到整数的操作时,数据的原子性值得考虑,Interlocked的操作代码如下 int i = 0; System.Threading.Interlocked.Increment(ref i); Console.WriteLine(i); System.Threading.Interlocked.Decrement(ref i); Console.WriteLine(i); System.Threading.Interlocked.Exchange(ref i, 100); Console.WriteLine(i); 输出信息如下 3.使用lock关键字 地球人都知道,使用lock关键字可以获取一个对象的独占权,任何需要获取这个对象的操作的线程必须等待以获取该对象的线程释放独占权,lock提供了简单的同步资源的方法,与Java中的synchronized关键字类似。… Read More
sqlserver删除数据库中所有的表 sqlserver删除数据库中所有的表 如果由于外键约束删除table失败,则先删除所有约束: –/第1步**********删除所有表的外键约束*************************/ DECLARE c1 cursor for select ‘alter table [‘+ object_name(parent_obj) + ‘] drop constraint [‘+name+’]; ‘ from sysobjects where xtype = ‘F’ open c1 declare @c1 varchar(8000) fetch next from c1 into @c1 while(@@fetch_status=0) begin exec(@c1) fetch next from c1 into @c1 end close c1 deallocate c1 –/第2步**********删除所有表*************************/ use 数据库名(是要删除表的所在的那个数据库的名称) GO declare @sql… Read More
About Log4Net在WEB中应用 如何使用log4net在Web中应用?其实很简单,你只要对程序作如何修改即可: 1.在common中加入log4netHelper.cs public class log4netHelper { public static void debug(string message) { log4net.ILog log = log4net.LogManager.GetLogger(“Test”); if (log.IsDebugEnabled) { log.Debug(message); } log = null; } public static void error(string message) { log4net.ILog log = log4net.LogManager.GetLogger(“Test”); if (log.IsErrorEnabled) { log.Error(message); } log = null; } public static void fatal(string message) { log4net.ILog log = log4net.LogManager.GetLogger(“Test”); if… Read More
ASP.NET程序中常用的三十三种代码 1. 打开新的窗口并传送参数: 传送参数: response.write(“<script>window.open(‘*.aspx?id=“+this.DropDownList1.SelectIndex+”&id1=“+…+”‘)</script>“) 接收参数: string a = Request.QueryString(“id”); string b = Request.QueryString(“id1”); 2.为按钮添加对话框 Button1.Attributes.Add(“onclick”,”return confirm(‘确认?’)”); button.attributes.add(“onclick”, ”if(confirm(‘are you sure…?’)){return true;}else{return false;}”) 3.删除表格选定记录 int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; string deleteCmd = “DELETE from Employee where emp_id = “ + intEmpID.ToString() 4.删除表格记录警告 private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) { switch(e.Item.ItemType) { case ListItemType.Item : case ListItemType.AlternatingItem : case… Read More
Problem in QQ’s install(side by side) When I reinstall QQ, there is a problem like: “application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.” refer to http://www.sevenforums.com/general-discussion/19958-qq-x_x-side-side-config.html then download: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14431 OK!… Read More