摘要: 1、html基本结构我的第一个网页2、文本相关标签 - color size face align 预格式文本,让文本保持原来风格,英雄本色特殊字符 < >3、超链接 href target="_blank"相对路径绝对路径根路径锚定 顶部 回到顶部4、图像 alt src width height border5、列表 type=disc, circle, square type=1,a,A,I,i6、表格align valign rowspan colspancellpadding填充 cellspacing间距 border borderc 阅读全文
posted @ 2013-09-04 01:05 水库 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 字符串常用的方法属性:1.ToCharArray 将字符串转化为字符数组。如: string s="asdfasdfasdf";char[] str=s.ToCharArray();2.Substring 取子字符串 如:string s="abcd" ;string str=s.substring(2,2);3.ToLower 转化为小写4。ToUpper转化为大写5.Join 合并字符串6.Split 分割字符串7。File.ReadAlllines 读取文件内容 string [] strs=File.ReadAlllines(@"路&q 阅读全文
posted @ 2013-07-07 00:22 水库 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 三层结构设计的基本原则1 DAL只提供基本的数据访问,不包含任何业务相关的逻辑处理;2 UI只负责显示和采集用户操作,不包含任何的业务相关的逻辑处理;3 BLL负责处理业务逻辑。通过获取UI传来的操作指令,决定执行业务逻辑在需要访问数据的时候直接交给DAL处理。处理完成后,返回必要数据给UI4 各层之间的引用关系: UI>BLL>DAL其中:DAL所在程序集不引用BLL和UI BLL需要引用DAL UI 直接引用BLL,可能会间接引用DAL 阅读全文
posted @ 2013-04-25 15:04 水库 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 一.定义: 1.继承: 把两个或多个类的相同属性提取出来,将这些属性合在一起建立父类!例:classA{publicvoidSum(inti,intj){intsum=i+j;Console.WriteLine("IamA,mysum={0}",sum);}}classB:A{publicvoidMinus(inti,intj){intminus=i-j;Console.WriteLine("IamB,myminus={0}",minus); this.Sum(3, 4); }}classInheritanceTest1{staticvoidMain(s 阅读全文
posted @ 2013-04-19 13:29 水库 阅读(2127) 评论(0) 推荐(2) 编辑
摘要: 浅入浅出触发器 一。创建触发器步骤:在SQL2005中,在“对象资源管理器”中---->数据库名称---->表---->触发器---->右键---->新建触发器二。前触发器和后触发器1。前触发器:instead of在数据变动以前被触发,并且取代数据变动的操作(DELETE/UPDATE/INSERT)而去执行触发器定义的操作。例:-- =============================================-- Author:牛腩-- Create date: 2013-04-17-- Description:删除类别触发器-- ======= 阅读全文
posted @ 2013-04-17 17:43 水库 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 一.产生的原因 例:1。在前台的语句是:insert into category(name) values('caName')2。在后台输入语句:娱乐新闻')delete category where id=3--3。执行时是将后台的语句代替caName,得到:insert into category(name) values(娱乐新闻')delete category where id=3--')此时,它执行两条语句,一是插入“娱乐新闻”,二是删除ID=3的数据. 于是,可以先补全原来的记录,然后加上自己的代码,从而达到目的。二。解决方法利用传入参数的 阅读全文
posted @ 2013-04-17 11:20 水库 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 将连接字符串放在Web表示层的Configuration中一。添加引用--->输入"using System.Configuration"二。在Configuration中输入: <connectionStrings> <add name ="connStr" connectionString ="server=SIKU;database=newssystem;uid=sa;pwd=123456"/> </connectionStrings >三。获取Configuration中的连接字符串 阅读全文
posted @ 2013-04-17 10:19 水库 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 法一:通常用法public DataTable ExecuteQuery(string sql) { string connStr = @"server=SIKU;database=newssystem;uid=sa;pwd=123456"; sqlconnection conn=new sqlconnection(connStr); conn.open(); string sql="select * from category"; sqlcommand cmd=new sqlcommand(sql,conn); sqlDataReader sdr=ne 阅读全文
posted @ 2013-04-17 10:16 水库 阅读(2948) 评论(0) 推荐(1) 编辑
摘要: 目的:判断类别名称是否已存在1.在DAL层中SQLHelper写入代码: /// <summary> /// 该方法执行传入的SQL查询语句 /// </summary> /// <param name="sql">SQL查询语句</param> /// <returns></returns> public DataTable ExecuteQuery(string sql) { DataTable dt = new DataTable(); string connStr = @"server 阅读全文
posted @ 2013-04-17 10:13 水库 阅读(1089) 评论(0) 推荐(0) 编辑
摘要: GridViw控件的使用1.从工具箱中拉出GridView2.绑定数据:protected void Page_Load(object sender, EventArgs e) { GridView1.DataSource = new CategoryDAO().SelectAll(); GridView1.DataBind(); } 阅读全文
posted @ 2013-04-17 10:10 水库 阅读(416) 评论(0) 推荐(0) 编辑