深入理解 SQL Server 2008 的锁机制
相比于 SQL Server 2005(比如快照隔离和改进的锁与死锁监视),SQL Server 2008 并没有在锁的行为和特性上做出任何重大改变。SQL Server 2008 引入的一个主要新特性是在表级控制锁升级行为的能力。新的LOCK_ESCALATION表选项允许你启用或禁用表级锁升级。这个新特性能够减少锁竞争并且改善并发性,特别是对于分区表(parti...
SQL Server 2008 R2 事务与隔离级别实例讲解
上班途中,你在一处ATM机前停了下来。正当你在敲入密码的时候,你的一位家人也正在镇上的另一处TAM机上输入密码。你打算从某个还有500元余额的账户上转出400元,而你的家人想从同一账户取走300元。倘若没有隔离级别的存在,麻烦就要来了......SQL Server 实现了6个隔离级别来防止并发情况下,类似上面例子中企图并发的访...
SQL Server 2008 R2 排序规则详解
一、 使用排序规则排序规则指定字符串数据如何比较和排序的规则,基于特定的语言与区域标准。例如,在ORDER BY子句中,如果按升序排列的话,说英语的人会期望字符串'Chiapas'出现在'Colima'之前;然而,说西班牙语的墨西哥人将期望以‘Ch’开头的单词出现在以'C'开头的单词列表的末尾。排序规则负责控制这些类型的比较...
Jira数据库配置
Jira必须使用关系数据库来存储issue数据。如果你正在进行全新的Jira安装,Jira安装向导将为你配置数据库连接--Jira内部的HSQL数据库或者外部的关系数据库。Jira内部的HSQL数据库适合于评估用途。然而,HSQL数据库容易损坏。如果用于生产目的,我们强烈推荐连接Jira到支持的外部关系数据库。这使得你能够利用你的数据库系...
Windows Phone FAQ
Here you can find troubleshootings for Windows Phone 7 application development.1. Connection failed because of invalid command-line arguments.Q: After setup Visual Studio 2010 ultimate sp1 and Windows Phone SDK 7.1, I created a sample Silverlight for Windows Phone application. It build successfully. While trying to debug it on Windows Phone Emulator, it threw an error message "Connection failed because of invalid command-line arguments" and failed to run.A: I have tried all kinds of wa
Android FAQ
You will find out troubleshooting for Android application development here.1. ADT installation problems: cannot find org.eclipse.wst.sse.core Q: I am running Windows 7 (64-bit) with Eclipse Indigo classic, Java 7 SDK, and Android SDK and AVD Manager (installer_r13-windows.exe). When I try to install the ADT in eclipse I get: Cannot complete the install because one or more required items could not be found. Software being installed: Android Development Tools 12.0.0.v201106281929-138431 (com.andro
Set up the Android SDK
This blog will show you how to set up the Android SDK on Windows 7 / Vista.OverviewHere's an overview of the steps you must follow to set up the Android SDK:Prepare your development computer and ensure it meets the system requirements. Download and install the SDK starter package. (If you're on Windows, download the installer for help with the initial setup.) Install the ADT Plugin for Eclipse (if you'll be developing in Eclipse). Add Android platforms and other components to your SDK. Explore t
An Examine Paper for .Net Programmer
Part I C# Programming Basis1. int a=10, int b=15. Please write a piece of code to swap a and b without using a third variable. (10)2. There is an array int[] max={6,5,2,9,7,4,0}. Please implement a Quick Sort method to sort this array order by descendent, and return the sorted array. (15)3. There are 2 sentences. Please implement a function to find out the words in one sentence that does not appear in the another one. (15)4. Write Unit Test Cases for the C# function you have written for Question
Using the Template Collection to Add a Template Column in WebDataGrid
WebDataGrid™ has a template collection to store common, reusable templates. You can add item templates to the collection using the WebDataGrid control's smart tag. You can also do this in code using the Templates collection. You can use the templates as you would for any templatable element in WebDataGrid. The collection gives you a place to store and quickly access templates that you plan to use often. Next I will show you how to add template column programmaticly.1. Define your custom Te
Raise Server-Side Click Event of CheckBox in a DataGrid Template Column
In an ASP.Net web page, there is a GridView control to show data retrieved from the database. And there is a CheckBox control in the template column of the GridView. When user click on the CheckBox to select/unselect the row on the gridview, and highlight the selected rows.Problem You need to respond to the checkbox change event, and know which check box on which row fired the event. The checkbox does not automatically call the datagrid's ItemCommand, so how can we access the datagridItem t
Convert Array of Objects to Data Table
Normally in a web application, the Presentation Layer retrieves an Array/Collection of business objects as the data source to bind to GridView control. However sometimes we do need a DataTable to return. In such cases we need convert an Array/Collection of object to a DataTable.Now let's look into te code.[C#]public DataTable ConvertArrayToTable(Array myList){DataTable dt = new DataTable();if (myList.Length > 0){PropertyInfo[] propInfos = myList.GetValue(0).GetType().GetProperties();foreach (
Import Data From MS Excel to DataSet without using COM Objects
In my last blog I demonstrated how to export data from a DataSet/DataTable to MS Excel file. In this blog I will show you the process reversed - import data from excel to a Dataset without using the COM objects.Now let's start with an code example.Code ExamplePublic Class DataImporterPublic Shared Function ImportExcelToDataSet(ByVal excelFullFileName As String, ByVal targetTable As String) As DataSetDim oledbConnection As OleDbConnection = GetOledbConnection(excelFullFileName)Dim commandText As
Export a DataSet to Microsoft Excel without using the COM objects
It is a routine job to export data from MS SQL Server database to MS Excel, or import data from MS Excel to MS SQL Server database. There are lot of solutions based on MS Excel COM object, which make youe application depends on MS Excel, and you must install MS Excel application on you web application server. This kind of solutions are discouraged for the following reasons.For security reason, your customer maybe would not like to install Excel application on the web application server.The Excel
Integrating/Using NUnit Test Framework with Visual Studio 2010 for ASP.NET MVC Application
ASP.NET MVC 2The Model-View-Controller (MVC) pattern is an architectural design principle that separates the components of a Web application. This separation gives you more control over the individual parts of the application, which lets you more easily develop, modify, and test them.ASP.NET MVC is part of the ASP.NET framework. Developing an ASP.NET MVC application is an alternative to developing ASP.NET Web Forms pages; it does not replace the Web Forms model.If you have installed Visual Studi
Introduce to Data Storage Objects in ASP.NET
Learn about the five powerful ASP.NET storage mechanisms, and how to quickly identify which to use for a given situation.IntroductionIn this brief tutorial, we'll look at five different ASP.NET objects we can use to store data. Two of these, the Application and Session objects, should be pretty familiar to anyone coming from ASP. The other three, Context, Cache and ViewState are brand new to ASP.NET. Each object is ideal under certain conditions, varying only in scope (that is the length of time
Query to Check SP/Table/Trigger Exists in Database or not
We often need create/update Stored Procedure,Tables or Triggers in database via SQL scripts. It is a best practice to check if these objects exist in the database before create/update them.Let's look at several examples1. Checking whether procedure exist in the NORTHWIND database with name 'CustOrdersDetail' Approach -1:use NORTHWINDif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CustOrdersDetail]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)print 'CustOrdersDetail Exists i
HTML Layout Guidelines for ASP.NET Web Page Globalization
The best practice for HTML layout is to ensure that localizers need to translate only strings, because the user interface sizes all controls to fit the text that the strings contain. This is a benefit because the step of manually resizing controls is removed from the localization process, thereby removing the errors and bugs that can result. However, the layout of the controls changes depending on string lengths, so localized Web sites need to be carefully tested.The following list provides reco
How to: Use Resources to Set Property Values in Web Server Controls
In an ASP.NET page, you can use the following methods to read values from resource files:Implicit localization ASP.NET fills property values from a local resource file based on matching keys to properties. By using a tool in Visual Web Developer, you can automatically mark all of the controls on a page for implicit localization.Explicit localization Create an expression that reads a specific resource from a local or global resource file. You should create expressions for every control proper
How to: Retrieve Resource Values Programmatically
You can use declarative syntax to set the values of ASP.NET server control properties to a resource value. Alternatively, you can retrieve resource values programmatically. You might do this if the resource value is not known at design time or if you want to set the resource value based on a run-time condition.You can get resource values from both local and global resource files that use methods that return an object that you can cast to the appropriate type. Because ASP.NET compiles global reso
ASP.NET Web Page Resources Overview
If you create Web pages that will be read by speakers of different languages, you must provide a way for readers to view the page in their own language. One approach is to re-create the page in each language. However, that approach can be labor intensive, error prone, and difficult to maintain as you change the original page.ASP.NET enables you to create a page that can obtain content and other data based on the preferred language setting for the browser or based on the user's explicit choice of