深蓝-大海的颜色

2016年1月7日

存储过程(分页查询代码)

摘要: USE [DHOA]GO/****** 对象: StoredProcedure [dbo].[DH_ListPage] 脚本日期: 03/09/2011 16:48:18 ******/SET ANSI_NULLS OFFGOSET QUOTED_IDENTIFIER OFFGO/*功能: ... 阅读全文

posted @ 2016-01-07 15:46 深蓝-大海的颜色 阅读(327) 评论(0) 推荐(0) 编辑

跨服务器连接数据库

摘要: set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgoCREATE PROCEDURE [dbo].[DH_ReceiveFileInserts] ( @djh NVARCHAR(50) , @djrq datetime , @f... 阅读全文

posted @ 2016-01-07 15:45 深蓝-大海的颜色 阅读(218) 评论(0) 推荐(0) 编辑

SQLserver日期函数

摘要: ------------------日期转化成年月日时分秒毫秒---------------select 'R'+CONVERT(varchar(100), GETDATE(), 112)+right(cast(power(10,2) as varchar)+DATEPART(hour, GETDA... 阅读全文

posted @ 2016-01-07 15:44 深蓝-大海的颜色 阅读(310) 评论(0) 推荐(0) 编辑

sql语句格式化数字(前面补0)、替换字符串

摘要: 以下是详细分析:1、select power(10,3)得到1000(即:10的3次方)2、select cast(1000+33 as varchar) 将1000转换类型(即:将int转化成varchar类型)3、select right(100033,3) 从右边取3个字符得到033将1格式化... 阅读全文

posted @ 2016-01-07 15:34 深蓝-大海的颜色 阅读(2897) 评论(0) 推荐(0) 编辑

备份还原数据库

摘要: 备份:BACKUP DATABASE "aaa" TO DISK ='C:\mybak.db' with init还原use masterRESTORE DATABASE "aaa" FROM DISK='D:\mybak.db' WITH REPLACE;use aaaaaa为数据库名 阅读全文

posted @ 2016-01-07 15:31 深蓝-大海的颜色 阅读(149) 评论(0) 推荐(0) 编辑

SQL获取汉字首字母

摘要: create function f_GetPy(@str nvarchar(4000))returns nvarchar(4000)asbegindeclare @strlen int,@re nvarchar(4000)declare @t table(chr nchar(1) collate C... 阅读全文

posted @ 2016-01-07 15:30 深蓝-大海的颜色 阅读(950) 评论(0) 推荐(0) 编辑

数据类型int、bigint、smallint 和 tinyint范围

摘要: bigint从 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807) 的整型数据(所有数字)。存储大小为 8 个字节。int从 -2^31 (-2,147,483,648) 到 2^31 - 1 (2,147,483,647) 的整型... 阅读全文

posted @ 2016-01-07 15:29 深蓝-大海的颜色 阅读(398) 评论(0) 推荐(0) 编辑

怎样用SQL语句查询一个数据库中的所有表?

摘要: 怎样用SQL语句查询一个数据库中的所有表?--读取库中的所有表名select name from sysobjects where xtype='u'--读取指定表的所有列名select name from syscolumns where id=(select max(id) from sysob... 阅读全文

posted @ 2016-01-07 15:28 深蓝-大海的颜色 阅读(749) 评论(0) 推荐(0) 编辑

SQL变量、Substring、charindex、case函数、去除重复

摘要: isnull(aa,0)删除表数据:truncate table aaa添加字段:ALTER TABLEtable1ADDcol1varchar(200)DEFAULT '2008-05-22'修改字段名:alter table table1 rename column col1 to col2;修... 阅读全文

posted @ 2016-01-07 15:27 深蓝-大海的颜色 阅读(357) 评论(0) 推荐(0) 编辑

C# Tostring格式

摘要: 开发中经常用到格式化,不管是时间、货币、数字都可以随心所欲。也许你用的是{0:C}方式,也许你用String.Format方式,也许你用.ToString("n"),都是格式化的方式。以下N多种格式化方式程序员们记住常用的就可以了,不常用的随用随查吧。字符型转换 转为字符串string.Remove... 阅读全文

posted @ 2016-01-07 15:25 深蓝-大海的颜色 阅读(377) 评论(0) 推荐(0) 编辑

asp.net导出word(word2007)

摘要: 1、只能导出成word2007格式(.docx),可直接导出到客户端2、服务器上不需要装任何东西,也没有权限限制,比较适合导出表格(支持图片)3、需要一个国外的DocX.dll插件4、需要添加引用:System.Drawing5、需要引用:using Novacode;using System.Dr... 阅读全文

posted @ 2016-01-07 15:23 深蓝-大海的颜色 阅读(411) 评论(0) 推荐(0) 编辑

asp.net生成缩略图

摘要: /// /// 生成缩略图 /// /// 原图片地址 /// 缩略图地址 /// 缩略图宽度 /// 缩略图高度 /// 生成缩略的模式 public void Ma... 阅读全文

posted @ 2016-01-07 15:22 深蓝-大海的颜色 阅读(128) 评论(0) 推荐(0) 编辑

正则表达式语法

摘要: 手机号验证System.Text.RegularExpressions.Regex.IsMatch(mobile, @"^1((([358])\d{9})|(47\d{8}))$")固话验证System.Text.RegularExpressions.Regex.IsMatch(Tel, @"^((... 阅读全文

posted @ 2016-01-07 15:21 深蓝-大海的颜色 阅读(182) 评论(0) 推荐(0) 编辑

解压缩

摘要: 需要下载引用ICSharpCode.SharpZipLib.dll这个文件using ICSharpCode.SharpZipLib.Zip;using System.IO;///////////////////////////////////调用//////////////////////////... 阅读全文

posted @ 2016-01-07 15:20 深蓝-大海的颜色 阅读(169) 评论(0) 推荐(0) 编辑

文件复制

摘要: #region 文件覆盖 /// /// 文件覆盖 /// /// public void FileCopy(string destPath) { string path ... 阅读全文

posted @ 2016-01-07 15:18 深蓝-大海的颜色 阅读(183) 评论(0) 推荐(0) 编辑

C#获取字符首字母

摘要: /// /// 获取字符首字母 /// public static string GetPyChar(string c) { if (string.IsNullOrEmpty(c)) ... 阅读全文

posted @ 2016-01-07 15:16 深蓝-大海的颜色 阅读(1638) 评论(0) 推荐(0) 编辑

生日转换成星座

摘要: /// /// 生日转换成星座 /// /// /// public static string GetAstro(DateTime birthday) { string value = string.Empty; int mo... 阅读全文

posted @ 2016-01-07 15:14 深蓝-大海的颜色 阅读(297) 评论(0) 推荐(0) 编辑

多选打包下载

摘要: using Ionic.Zip;/////////////////在对多文件打包中用到了 DotNetZip 的方法来实现对多文件压缩打包。需要到http://dotnetzip.codeplex.com/处下载该文件,然后引用Ionic.Zip即可 public void PackDown() ... 阅读全文

posted @ 2016-01-07 15:13 深蓝-大海的颜色 阅读(140) 评论(0) 推荐(0) 编辑

数码照片的文件高级信息获取

摘要: ////调用 string strfile = "fffff.jpg";//文件名 System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(strfile); exif.exifextractor er = new exif... 阅读全文

posted @ 2016-01-07 15:12 深蓝-大海的颜色 阅读(530) 评论(0) 推荐(0) 编辑

DES跨(C# Android IOS)三个平台通用的加解密方法

摘要: #region 跨平台加解密(c# 安卓 IOS) // public static string sKey = "12345678"; // /// // /// 解密 // /// // /// 要解密的以Base64 // /// 密钥,且必须为8位 //... 阅读全文

posted @ 2016-01-07 15:09 深蓝-大海的颜色 阅读(448) 评论(0) 推荐(0) 编辑

导航