笨小孩做开发

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年4月1日

摘要: int[] array = { 2, 4, 5, 9, 1, 3, 5, 6, 7 }; int temp = 0; for (int i = 0; i < array.Length - 1; i++) { for (int j = i + 1; j < array.Length; j++) { if (array[j] < array[i]) { temp = array[i]; array[i] = array[j]; array[j] = temp; } } } for (int i = 0; i < array.Length; i ++ ) { Console. 阅读全文
posted @ 2013-04-01 09:39 笨小孩做开发 阅读(126) 评论(0) 推荐(0) 编辑

2013年3月21日

摘要: using System;using System.Data;using System.IO;using System.Xml;namespace DotNet.Utilities{ public class XMLProcess { #region 构造函数 public XMLProcess() { } public XMLProcess(string strPath) { this._XMLPath = strPath; } #endregion #region 公有属性 private string _XMLPath; public string XMLPath { get { ret 阅读全文
posted @ 2013-03-21 15:42 笨小孩做开发 阅读(186) 评论(0) 推荐(0) 编辑

摘要: using System.Xml;using System.Data;namespace DotNet.Utilities{ /// <summary> /// Xml的操作公共类 /// </summary> public class XmlHelper { #region 字段定义 /// <summary> /// XML文件的物理路径 /// </summary> private string _filePath = string.Empty; /// <summary> /// Xml文档 /// </summary& 阅读全文
posted @ 2013-03-21 15:41 笨小孩做开发 阅读(237) 评论(0) 推荐(0) 编辑

2013年3月11日

摘要: <script type="text/javascript"> function MyFun(date2 , date1) { var type1 = typeof date1, type2 = typeof date2; if(type1 == 'string') date1 = stringToTime(date1); else if(date1.getTime) date1 = date1.getTime(); if(type2 == 'string') date2 = stringToTime(date2); else i 阅读全文
posted @ 2013-03-11 14:13 笨小孩做开发 阅读(272) 评论(0) 推荐(0) 编辑

2013年3月10日

摘要: update dbo.LeaveDocuments set DataDay = convert(float , (SELECT DATEDIFF(day, CreateTime , getdate()) AS no_of_daysFROM dbo.LeaveDocuments where LeaveID = 'ZYQJ2013030002')) where TaskID =188 阅读全文
posted @ 2013-03-10 20:07 笨小孩做开发 阅读(243) 评论(0) 推荐(0) 编辑

2013年3月8日

摘要: public class Produce { #region 增加单条记录 public static int ProductAdd(produce product) { StringBuilder strSql = new StringBuilder(); strSql.Append(" insert into dbo.produce ( CategoryID,produceName,producePrice,produceStock,produceDescription)"); strSql.Append(" values (@CategoryID,@prod 阅读全文
posted @ 2013-03-08 15:12 笨小孩做开发 阅读(786) 评论(0) 推荐(0) 编辑

摘要: using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using System.Configuration;namespace MyBookShopSys.DAL{ /// <summary> /// </summary> public static class DBHelper { private static SqlConnection connection; public static SqlConn 阅读全文
posted @ 2013-03-08 15:06 笨小孩做开发 阅读(537) 评论(0) 推荐(0) 编辑

摘要: /// <summary> /// 将一个列表转换成DataTable,如果列表为空将返回空的DataTable结构 /// </summary> /// <typeparam name="T">要转换的数据类型</typeparam> /// <param name="entityList">实体对象列表</param> public static DataTable EntityListToDataTable<T>(List<T> entityList) 阅读全文
posted @ 2013-03-08 14:43 笨小孩做开发 阅读(749) 评论(0) 推荐(0) 编辑

摘要: ---------------------------------方法名------------------------------------------------------------------------------------------------------/// <summary> /// 将一个DataTable转换成列表 /// </summary> /// <typeparam name="T">实体对象的类型</typeparam> /// <param name="dt" 阅读全文
posted @ 2013-03-08 14:28 笨小孩做开发 阅读(341) 评论(0) 推荐(0) 编辑

2013年3月7日

摘要: Sql2008数据库转到sql2005这个问题耽误了一天时间,从网上找了好多方法,终于可以搞定了。现在把我收集的方法给大家分享一下。建议先使用第四个方法,可能是数据库太大了,前三个方法我的都没有成功,第四个方法虽然也有失败的,但总算转换过去了。解决方法一:脚本生成(笨方法)sql08导出的脚本在05下兼容性不行,执行的时候会报错。1、 点击“开始 > 程序 > Microsoft Sql Server 2008 > SQL Server Management Studio”2、 在出现的“连接到数据库服务器”对话框,服务器类型选“数据库引擎”,服务器名称选择本机的SQL Se 阅读全文
posted @ 2013-03-07 13:10 笨小孩做开发 阅读(775) 评论(0) 推荐(0) 编辑