create proc sp_InsertSplite(@s text)asbegindeclare @str nvarchar(100)DECLARE CusCursor CURSOR FOR select col from dbo.f_splitStr(@s,';')OPEN CusCursorFETCH NEXT FROM CusCursor INTO @strWHILE (@@FETCH_STATUS = 0)BEGIN declare @start1 int,@start2 int declare @col1 varchar(50),@col2 nvarchar(50 Read More
posted @ 2013-02-18 15:42 一抹、思乡泪 Views(265) Comments(0) Diggs(0) Edit
DECLARE @MyCounter INTSET @MyCounter = 0 /*设置变量*/WHILE (@MyCounter < 1000000) /*设置循环次数*/BEGIN--WAITFOR DELAY '000:00:01' /*延迟时间10秒*/insert Test(TestValue) values(GETDATE())SET @MyCounter = @MyCounter + 1END Read More
posted @ 2013-02-18 15:41 一抹、思乡泪 Views(150) Comments(0) Diggs(0) Edit
new关键字的作用:运算符修饰符约束运算符:创建对象和调用构造函数,这个相信大家都会用,很多人没事就喜欢new一下 ∩_∩ClassDemo demo=new ClassDemo()修饰符:隐藏基类中的成员(是基类中的成员,所以字段、属性、事件等等都可以隐藏,不单单是方法哦)public class Car{ public void WriteName(string name) { Console.WriteLine(name); }}public class NewCar:Car{ public void WriteName(string name) ... Read More
posted @ 2013-01-26 10:56 一抹、思乡泪 Views(4876) Comments(0) Diggs(0) Edit
方法一:params 参考MSDNhttp://msdn.microsoft.com/zh-cn/library/w5zay9db(v=vs.80).aspx方法二:将参数封装为一个对象方法三: public static void MsgFounction(string username,bool isChina=true) { Console.WriteLine(string.Concat(username, ":", isChina)); }设置方法参数默认值,调用时:MsgFounction("张三");MsgFounction("aa Read More
posted @ 2013-01-12 15:28 一抹、思乡泪 Views(379) Comments(0) Diggs(0) Edit
路由器: public class SubInfoController : Controller { // // GET: /SubInfo/ /// <summary> /// 传值路由(初始化界面) /// </summary> /// <returns></returns> public ActionResult SubMessage() { return View(); } /// <summary> //... Read More
posted @ 2013-01-10 16:38 一抹、思乡泪 Views(239) Comments(0) Diggs(0) Edit
@Html.ActionLink((string)@ViewBag.Message, "Index")//相同路径@Html.ActionLink((string)@ViewBag.Message, "Index","New")//New目录下 Read More
posted @ 2013-01-07 13:20 一抹、思乡泪 Views(133) Comments(0) Diggs(0) Edit
api函数:1 [DllImport("user32.dll")]//取设备场景2 private static extern IntPtr GetDC(IntPtr hwnd);//返回设备场景句柄3 4 [DllImport("gdi32.dll")]//取指定点颜色5 private static extern int GetPixel(IntPtr hdc, Point p);主要方法: Timer tim = new Timer(); tim.Interval = 1; tim.Tick += delegate { Point p ... Read More
posted @ 2012-11-06 11:39 一抹、思乡泪 Views(4876) Comments(3) Diggs(3) Edit
int[] arr = new int[] { 1, 5, 6, 9, 2, 45, 36 };//任意数组 Recursion(arr, arr.Length - 1); foreach (var item in arr) { Console.WriteLine(item); } /// <summary> /// 递归遍历 /// </summary> /// <param name="arr">数组</param> ///... Read More
posted @ 2012-10-17 11:22 一抹、思乡泪 Views(603) Comments(0) Diggs(1) Edit
今天看一到哥们问了我个goto冒泡排序的问题,只是用goto实现下,没什么实用性:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace DemoMsg{ class Program { static void Main(string[] args) { int[] arr = new int[] { 1, 5, 6, 9, 2, 45, 36 }; foreach (int n in arr) { Console.WriteLine(n); } Console.Wr Read More
posted @ 2012-10-13 15:04 一抹、思乡泪 Views(364) Comments(0) Diggs(0) Edit
反射这东西,包含的内容很多,园子里很多前辈、朋友们也写过很多关于他的文章,今天我就不写那些理论、含义什么(我也就学了点皮毛而已,就不丢人现眼了),就简单介绍一下怎么用反射从sql中读取字段并填充对象;刚学C#的朋友,我想只要你写过学生管理系统、XX系统、等等的时候,都会写这样的代码吧: 1 /// <summary> 2 /// 获取城市信息列表 3 /// </summary> 4 /// <returns></returns> 5 public List<CityCode> OldGetCitys() 6 ... Read More
posted @ 2012-09-17 22:54 一抹、思乡泪 Views(1484) Comments(8) Diggs(1) Edit