摘要:
1数据库读取字段截取select substring(Name,0,5)+ '...' as Tname from T_MobileBusiness 分割字段查询其他的用代号代替方法一:在.aspx页中写代码。比如,你需要截取30个字符,多于30个字符的话,用前30个字符加省略号表示。<%#Eval("your_string").ToString().Length>30?Eval("your_string").ToString().Substring(0,30)+"...":Eval("your_ 阅读全文
摘要:
时间字段模糊查询 where convert(varchar,PublishTime,120) like '%2010-11-28%'SELECT TOP 1000 [SMSGUID] ,[Mobiles] ,[SmsContent] ,[SysInfo] FROM ... 阅读全文
摘要:
一次删除所有表SQL语句如下:declare @tname varchar(8000)set @tname=''select @tname=@tname + Name + ',' from sysobjects where xtype='U'select @tname='drop table ' + left(@tname,len(@tname)-1)exec(@tname)删除所有存储过程的sql语句 用到游标declare @procName varchar(500)declare cur cursorfor select [ 阅读全文
摘要:
View Code 1 USE WyManager 2 3 DECLARE Del_Cursor CURSOR 4 FOR 5 SELECT 'DROP PROCEDURE ' + name from dbo.sysobjects WHERE OBJECTPROPERTY(id, N'IsProcedure') = 1 AND name not like 'USP_Blog%' 6 OPEN Del_Cursor 7 DECLARE @curname sysname 8 FETCH NEXT FROM Del_Cursor into @curna 阅读全文
摘要:
//今天 DateTime.Now.Date.ToShortDateString(); //昨天,就是今天的日期减一 DateTime.Now.AddDays(-1).ToShortDateString(); //明天,同理,加一 DateTime.Now.AddDays(1).ToShortDateString(); //本周(要知道本周的第一天就得先知道今天是星期几,从而得知本周的第一天就是几天前的那一天,要注意的是这里的每一周是从周日始至周六止 DateTime.Now.AddDays(Convert.ToDouble((0 - Convert.ToInt16(DateTime.Now. 阅读全文