纸上得来终觉浅,绝知此事要躬行。

 
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 31 下一页

2013年10月29日

Linux时间转Windows时间

摘要: 环境:OS:Windows Server 2012SQL:2012 Enterprise 中文版需求:经理给了一个这样的 Linux 时间字符串:"28/Oct/2013 14:30:21";要求转换成:"2013-10-28 14:30:21" 这样的格式。其实看到这个字符串第一个想到的就是 SQL Server 里面的 Convert 函数和 Cast 函数。于是就写了一下转换代码,如下:declare @t varchar(100)Select @t =CONVERT(varchar(100), '28/Oct/2013 14:30:21& 阅读全文

posted @ 2013-10-29 20:12 JRoger 阅读(1324) 评论(0) 推荐(0) 编辑

2013年10月18日

SQL Server 2012 新的分页方法

摘要: 数据库环境: SQL Server 2012使用到的关键字: offset、fetch、next、rows简单示例:declare @pageSize int,@currentPage intset @pageSize = 5set @currentPage = 2select * from AnalysisCodeorder by Id offset (@currentPage-1)*@pageSize rows fetch next @pageSize rows only;这句SQL的意思就是:跳过 (@currentPage-1)*@pageSize 条记录,查询之后的 @pageS.. 阅读全文

posted @ 2013-10-18 09:19 JRoger 阅读(337) 评论(0) 推荐(0) 编辑

2013年10月12日

Visual Studio 2012出现“无法访问T-SQL组件和安装了不兼容伯 DacFx版本”的解决办法

摘要: 前段时间就发现了这个错误,但是没有去关注它。今天有点儿空儿,找到了解决方法。特此贴出来。环境OS : Windows Server 2012 或 Windows 8IDE : Visual Studio 2012 SP3SQL : SQL Server 2012出现原因给系统打了MS推出的与SQL Server相关的补丁。再使用Visual Studio 2012 时就发现VS自带的SQL Server Data Tools不能用了。提示如下图的错误:解决办法从MS官方下载最新的SQL Server Data Tools就可以解决。地址:http://msdn.microsoft.com/zh 阅读全文

posted @ 2013-10-12 13:10 JRoger 阅读(3953) 评论(0) 推荐(0) 编辑

2013年9月7日

Python django-admin.py startproject 不正常【解决方案】

摘要: 系统Windows Server 2012,当使用python django-admin.py startproject myprojectmyproject表示要创建的站点的名称,当上面的命令执行完成后,会生成一个myproject文件夹及几个文件,如下: + myproject +--- __init__.py +--- settings.py +--- urls.py +--- wsgi.py当不能正常执行上面的命令时,可以把django-admin.py的全路径写出来,如:python d:\Python27\Scripts\jango-admin.py startproje... 阅读全文

posted @ 2013-09-07 23:38 JRoger 阅读(7183) 评论(1) 推荐(0) 编辑

Python+Django数据库配置及使用——执行原始SQL

摘要: 开发环境OS:Windows Server 2012Python:2.7.5Django:1.5.2通过settings.py配置数据库DATABASES = { 'default': { #'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'ENGINE': 'django.db.backends.sqlite3' 阅读全文

posted @ 2013-09-07 23:37 JRoger 阅读(8540) 评论(0) 推荐(0) 编辑

Python+Django静态文件配置

摘要: 环境: OS:Windows Server 2012 Python:2.7.5 Django:1.5.2站点目录结构: 创建 Django Web项目参见:创建Django Web 项目配置步骤:在settings.py文件中引用命令空间:import os.path 2. 配置STATICFILES_DIRS变量,代码如下:# Absolute path to the directory static files should be collected to.# Don't put anything in this directory yourself; store your st. 阅读全文

posted @ 2013-09-07 23:37 JRoger 阅读(560) 评论(0) 推荐(0) 编辑

Python+Django数据库配置及使用——执行原始SQL并返回模型实例

摘要: 开发环境OS:Windows Server 2012Python:2.7.5Django:1.5.2通过settings.py配置数据库参见:Python+Django数据库配置及使用——执行原始SQL创建数据模型# -*- coding:utf-8 -*-from django.db import models'''用户实体类,通过映射为对象赋值.'''class CustomerInfo(models.Model): Id = models.IntegerField(null=True, primary_key=True, db_column 阅读全文

posted @ 2013-09-07 23:35 JRoger 阅读(799) 评论(0) 推荐(0) 编辑

C#自定义序列化反序列化与 ISerializable 接口

摘要: ISerializable 接口MSDN注解:允许对象控制其自己的序列化和反序列化过程。ISerializable 接口的定义:public interface ISerializable{ void GetObjectData(SerializationInfo info, StreamingContext context);}意思就是我们可以通过实现ISerializable 接口来控制序列化与反序列化后的结果。但是只有使用BinaryFormatter 时才有用。使用JavaScriptSerializer 类并没有效果。下面通过一个示例学习一下。示例定义实现ISerializab... 阅读全文

posted @ 2013-09-07 18:46 JRoger 阅读(6797) 评论(0) 推荐(0) 编辑

2013年9月6日

PHP 数据持久化抽象类

摘要: 阅读全文

posted @ 2013-09-06 18:47 JRoger 阅读(513) 评论(0) 推荐(0) 编辑

2013年9月2日

通过点击网页链接打开应用程序——自定义协议

摘要: 使用场景如果开发的项目有客户端还有网站,那就可能考虑增加此功能,它可以让用户获取更好的体验。已使用类似功能的产品:腾讯QQ、阿里旺旺等,这里只列出了大家平时最常用的。下面介绍开发流程。注册自定义协议/// /// 注册自定义协议。/// public class RegisterCustomProt... 阅读全文

posted @ 2013-09-02 17:58 JRoger 阅读(1164) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 31 下一页

导航