Posted 九月 4th, 2009 by o2ho in category
技术,
资源
protected void ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if ((e.Item.ItemType.Equals(ListItemType.Item) || e.Item.ItemType.Equals(ListItemType.AlternatingItem)) && (e.Item.ItemIndex + 1) % ProductsPerPage == 0)
{
e.Item.Controls.Add(new LiteralControl("<tr><td class=\"PageBreak\" ></td></tr>"));
}
Posted 二月 11th, 2009 by o2ho in category
工作,
技术
mso-number-format:"0"
NO Decimals
mso-number-format:"0\.000"
3 Decimals
mso-number-format:"\#\,\#\#0\.000"
Comma with 3 dec
mso-number-format:"mm\/dd\/yy"
Date7
mso-number-format:"mmmm\ d\,\ yyyy"
Date9
mso-number-format:"m\/d\/yy\ h\:mm\ AM\/PM"
D -T AMPM
mso-number-format:"Short Date"
01/03/1998
mso
Posted 十二月 1st, 2008 by o2ho in category
技术
create table aaa
(
col nvarchar(10)
)
insert into aaa
select 1
union
select 2
union
select 3
declare @sql varchar(8000)
set @sql='select '
select @sql=@sql+'max(case col when '''+ col +''' then col end) + '','' + '
from (select distinct col from aaa) a
set @sql=left(@sql,len(@sql)-1)
set @sql=@sql+' from aaa'
--print @sql
Posted 十月 27th, 2008 by o2ho in category
工作,
技术
public void EnumInstanceFromInt()
{
// The .NET Framework contains an Enum called DayOfWeek.
// Let's generate some Enum instances from int values.
// Usually you wouldn't cast an instance of an existing Enum to an int
// in order to create an Enum instance. :-) You would have the actual
// integer value, perhaps a value from a database w
Posted 十月 8th, 2008 by o2ho in category
技术
Windows Registry Editor Version 5.00
@="Test"
"URL Protocol"="应用程序路径 %l"
@="%SystemRoot%\\system32\\url.dll,0"
@="应用程序路径 %l"
注意: %1是百分号加上数字1
在网页上加一个这样的链接:
<a href='Test://para1¶2¶3'>启动桌面应用程序</a>
如果用户点击这个网页链接,在注册表中对应的应用程序就可以被启动了。
来源: http://www.cnblogs.com/ilovejolly/archive/2007/06/25/7
Posted 九月 25th, 2008 by o2ho in category
技术
DateTime.ParseExact(输入的字符串,"yyyyMMdd",System.Globalization.CultureInfo.CurrentCulture)
Posted 九月 18th, 2008 by o2ho in category
技术
var query = (from p in dc.GetTable<Person>()
join pa in dc.GetTable<PersonAddress>() on p.Id equals pa.PersonId into tempAddresses
from addresses in tempAddresses.DefaultIfEmpty(new PersonAddress())
select new { p.FirstName, p.LastName, addresses.State });
Posted 八月 29th, 2008 by o2ho in category
工作,
技术
只需要在页面中加入如下HTTP meta-tag:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
只要IE8一读到这个标签,它就会自动启动IE7兼容模式,保证页面完整展示.
还有一种方法是针对整个网站的,在IIS中加入如下描述符就可以有相同的效果,当然这么做范围更广.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-UA
Posted 二月 13th, 2008 by o2ho in category
工作,
技术
using System.Globalization;
GregorianCalendar gc = new GregorianCalendar();
int weekOfYear = gc.GetWeekOfYear(DateTime.Now, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
写成通用的方法,获取某一日期是该年中的第几周
using System.Globalization;
/// <summary>
/// 获取某一日期是该年中的第几周
/// </summary>
/// <param name="dt">日期</param>
/// <retu