摘要:
SQL Server 2008 对数据库进行还原操作的时候,可能出现“因为数据库正在使用,所以无法获得对数据库的独占访问权”的提示,原因是一些链接未能关闭,可以用如下语句:USE MasterALTER DATABASE数据库名称 SET OFFLINE WITH ROLLBACK IMMEDIATE 阅读全文
摘要:
循环语句是编程的基本语句,在C#中除了沿用C语言的循环语句外,还提供了foreach语句来实现循环。那么我要说的就是,在循环操作中尽量使用foreach语句来实现。为了来更好地说明为什么要提倡使用foreach,用如下三种不同方式来编写循环语句。 int[] nArray = new int[100]; // Use "foreach" to loop array foreach( int i i... 阅读全文
摘要:
C#的样例代码using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{ class Person { public int Blood = 10; } class Program { public static void Add(int x) { x += 10; ... 阅读全文