2009年12月9日

SQL中获得EXEC后面的sql语句或返回值的方法

摘要: 前言:在数据库程序开发的过程中,我们经常会碰到利用EXEC来执行一段需要返回某些值的sql语句(通常是构造动态sql语句时使用),或者在一个存储过程中利用EXEC调用另一个有返回值的存储过程(必须获得返回值),那么如何获得这些返回值呢?1.EXEC执行sql语句的情况declare @rsql varchar(250)declare @csql varchar(300)declare @rc nvarchar(500)declare @cstucount intdeclare @ccount intset @rsql='(select Classroom_id from EA_Room 阅读全文

posted @ 2009-12-09 23:43 tigerhuolh 阅读(2861) 评论(0) 推荐(0) 编辑

2009年12月8日

SQL行转列

摘要: declare @Testtable table(FType varchar(100),FName varchar(100))insert @Testtable select '学历','博士'insert @Testtable select '学历','学士'insert @Testtable select '学历','硕士'insert @Testtable select '证件类型','军官证'insert @Testtable select '证件类型 阅读全文

posted @ 2009-12-08 21:05 tigerhuolh 阅读(136) 评论(0) 推荐(0) 编辑

怎样去掉拼接的字符串的最后一个多余的分割符

摘要: 比如页面上有一个CheckBoxList,保存的时候要求,把选中的值拼接成一个以','为分割符的字符串寸到数据库中。string str = "";foreach (ListItem li in CheckBoxList1.Items){str += li.Value+",";} str = str . TrimEnd(',') 阅读全文

posted @ 2009-12-08 13:28 tigerhuolh 阅读(399) 评论(0) 推荐(0) 编辑

2009年12月7日

线程的两种启动方式

摘要: 1、没有参数的启动方式:using System;using System.Collections.Generic;using System.Text;using System.Threading;namespace MoreThead{ class TheadProgram { Thread th; static void Main(string[] args) { TheadProgram tp = new TheadProgram(); tp.RunThread(); } private void RunThread() { //启动一个不带参数的线程 th = new Thread(n 阅读全文

posted @ 2009-12-07 21:55 tigerhuolh 阅读(386) 评论(0) 推荐(0) 编辑

使用C#实现WinForm窗体的动画效果

摘要: 【转】http://www.cnblogs.com/xvqm00/archive/2009/02/16/1391313.htmlusingSystem.Runtime.InteropServices; publicclassWin32 { publicconstInt32AW_HOR_POSITIVE=0x00000001;//从左到右打开窗口 publicconstInt32AW_HOR_NEGATIVE=0x00000002;//从右到左打开窗口 publicconstInt32AW_VER_POSITIVE=0x00000004;//从上到下打开窗口 publicconstInt32AW 阅读全文

posted @ 2009-12-07 13:19 tigerhuolh 阅读(449) 评论(0) 推荐(0) 编辑

C#多线程编程简述

摘要: NET将关于多线程的功能定义在System.Threading名字空间中。因此,要使用多线程,必须先声明引用此名字空间(using System.Threading;)。a.启动线程顾名思义,“启动线程”就是新建并启动一个线程的意思,如下代码可实现:Thread thread1 = new Thread(new ThreadStart( Count));其中的 Count 是将要被新线程执行的函数。b.杀死线程“杀死线程”就是将一线程斩草除根,为了不白费力气,在杀死一个线程前最好先判断它是否还活着(通过 IsAlive 属性),然后就可以调用 Abort 方法来杀死此线程。c.暂停线程它的意思 阅读全文

posted @ 2009-12-07 12:50 tigerhuolh 阅读(153) 评论(0) 推荐(0) 编辑

windows服务是什么以及作用

摘要: 什么是系统服务? 在Windows 2000/XP/2003系统中,服务是指执行指定系统功能的程序、例程或进程,以便支持其他程序,尤其是低层(接近硬件)程序。通过网络提供服务时,服务可以在Active Directory(活动目录)中发布,从而促进了以服务为中心的管理和使用。 服务是一种应用程序类型,它在后台运行。服务应用程序通常可以在本地和通过网络为用户提供一些功能,例如客户端/服务器应用程序、Web服务器、数据库服务器以及其他基于服务器的应用程序。 系统服务的作用? (1)启动、停止、暂停、恢复或禁用远程和本地计算机服务。 (2)管理本地和远程计算机上的服务。 (3)设置服务失败时的故障恢 阅读全文

posted @ 2009-12-07 11:56 tigerhuolh 阅读(1354) 评论(0) 推荐(0) 编辑

导航