摘要: use mastergoif exists(select name from sys.databases where name='Test_')drop database Test_gocreate database Test_gouse Test_goif exists(select name from sys.objects where name='Table_')drop table Table_gocreate table Table_(ID int identity(100,1),Tname varchar(50))goif exists(select name from sys.o 阅读全文
posted @ 2011-01-05 23:35 Curitis 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 登陆if object_id('Admin') is not nulldrop table Admingo--创建Admin表create table Admin( _id int identity(1000,1),--编号,自动增长 _name nvarchar(50),--名字 _pwd nvarchar(50),--密码 _lastlogintime datetime,--最后一次登录时间 _lastloginip nvarchar(50)--最后一次登陆的IP constraint Admin__id_FK primarykey(_id)--主键)go--插入一条数据insert in 阅读全文
posted @ 2010-12-27 20:01 Curitis 阅读(238) 评论(0) 推荐(0) 编辑
摘要: --使用master数据库use mastergo--判断数据库中是否含有Data数据库if exists(select name from sys.databases where name='HaHa')drop database HaHago--创建Data数据库create database HaHago--使用Data数据库use HaHagoif object_id('TableOne') is not nulldrop table TableOnegoset nocount ongocreate table TableOne(_id varchar(50),_name varcha 阅读全文
posted @ 2010-12-26 23:10 Curitis 阅读(164) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;//引入名称空间using System.Data;//DataSetusing System.Data.SqlClient;//SqlParameterusing System.Configuration;//web.confignamespace DBSQLHelper{ public class SQLHelper { //<connectionStrings> //<add name="conne 阅读全文
posted @ 2010-12-11 21:08 Curitis 阅读(278) 评论(0) 推荐(0) 编辑
摘要: create procedure Page@tablename varchar(50),@primarykey varchar(50),@pageindex int,@pagesize int,@where varchar(1000)as declare @strsql varchar(5000); begin if(@where='') begin set @strsql='select top '+cast(@pagesize as varchar(50))+' * from '+@tablename+' where '+@primarykey+' not in (select top ' 阅读全文
posted @ 2010-12-07 17:04 Curitis 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 创建一个空的解决方案创建表现层(web)、创建业务逻辑层(BLL)、创建数据访问层(DAL)注释:这个web就是项目,可以是“web应用程序”“winform应用程序”,后面的两层是“类库”(在新建类库的时候系统默认的会创建一个类文件,最好将系统自己生成的类文件删掉)创建实体类(MODEL)注释:很多刚开始接触三层的人都弄不清楚这个,一般都会认为这个也是一层,其实不是的,这个里面只是将数据源中的表中的字段进行封装的一些类文件,并不是层。实体类是必不可少的,因为每一层都要引用它。这个和我们以前学过的面向对象里面的一个东西其实是一样的就是“属性”,将数据源中的列名看成是字段,要将这些字段封装成属性 阅读全文
posted @ 2010-12-05 11:23 Curitis 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 可以直接将创建的Access或者是Excel数据源文件直接放到项目中去,就是将数据源文件直接复制粘贴到App_Data文件夹下面的,这里的复制不是直接将文件拖进来,而是复制文件将数据文件复制到目录下面去,然后点击解决方案上面有个显示所有文件的按钮,然后将数据文件包含在项目中就行了!Access作为数据源//引入命名空间using System.Data.OleDb;namespace WebApplication{ public class AccessHelper { static readonly string strConnection = "Provider=Microsoft.ACE 阅读全文
posted @ 2010-12-04 22:07 Curitis 阅读(684) 评论(0) 推荐(0) 编辑
摘要: namespace MyClass{public class Animal //创建一个类{string type; //声明了类成员string typepublic void SetType(string type) //声明了类方法{this.type = type; //字段赋值}}class Program //主程序类{static void Main(string[] args) /... 阅读全文
posted @ 2010-11-25 12:14 Curitis 阅读(242) 评论(0) 推荐(0) 编辑
摘要: protected void Page_() { linkFirst.Enabled = true; linkUp.Enabled = true; linkUp.Enabled = true; linkDown.Enabled = true; string strsql = "select * from newsinfo"; DataSet ds = Sh.GetDataSource(strsql... 阅读全文
posted @ 2010-11-25 09:43 Curitis 阅读(140) 评论(0) 推荐(0) 编辑
摘要: CSS文件body,div,ul,li{padding:0; margin:0;}#nav{width:800px;height:35px;background:#CCC;margin:0 auto;/*上下为:0;左右自动匹配浏览器*/margin-top:30px;}#nav ul{width:800px;height:35px;}#nav ul li{ float:left;}/*这个是消除... 阅读全文
posted @ 2010-11-08 14:15 Curitis 阅读(174) 评论(0) 推荐(0) 编辑