2010年4月20日 星期二

javascript的showModalDialog與window.open造成session遺失的問題

Session掉了有很多種可能,

不過如果程式裡面有用到javascript進行開窗的動作,

那就很有可能是因為混著用showModalDialog跟window.open導致session遺失。

簡單來講,就是

ShowModalDialog之後,不能用window.open來開窗,否則新視窗裡面無法讀取Session

簡單的例子,混著用這兩種開窗:

open 代表 window.open
modal 代表 window.showModalDialog


Y = session 還在
N = session 不見了

連續開窗使用方式 Session是否仍然存在
open/open/open Y/Y/Y
modal/modal/modal Y/Y/Y
open/modal/open Y/Y/N
modal/open/modal Y/N/N
open/modal/modal Y/Y/Y


2010年1月20日 星期三

NPOI介紹相關參考資料

在.NET上的POI:NPOI
POI專案本身的處理Office檔案的函式庫,包含Word、Excel、PowerPoint、OutLook、Visio、Publisher等檔案。
參考網址
在Server端存取Excel檔案的利器:NPOI Library
NPOI簡介
NPOI Downloads

2009年11月25日 星期三

2009年11月24日 星期二

IE點選視窗的X時觸發某一事件

=====HTML部分========

加上一個LinkButton




=======JAVASCRIPT========
function onBeforeUnload()
{
__doPostBack('LinkButton1','');
}

=================================
LinkButton1_Click寫進資料庫之類的程式

2009年11月11日 星期三

Oracle 的 @@IDENTIFY 抓 INSERT 的 PK

INSERT INTO TABLE01 (SYS_PK, F1, F2) VALUE( SYS_GUID(), 'xxx', 'yyy') RETURNING SYS_PK INTO :UOTPARAM
再用  ParameterDirection.Output
抓出來

2009年11月8日 星期日

Responses to “Pivoting in SQL using the 10g Model Clause”

here is a performace test i’ve maded on worked_hours.

insert into work_hours select mod(rownum,56),
rownum,mod(rownum,7),1 from dba_objects;

select count(1) from worked_hours;
49647

select weekno
, empno
, mon
, tue
, wed
, thu
, fri
, sat
, sun
from worked_hours
model
return updated rows
partition by (weekno, empno)
dimension by ( day )
measures ( hours, 0 mon, 0 tue, 0 wed, 0 thu, 0 fri, 0 sat, 0 sun)
RULES upsert
(
mon [0] = hours [1]
, tue [0] = hours [2]
, wed [0] = hours [3]
, thu [0] = hours [4]
, fri [0] = hours [5]
, sat [0] = hours [6]
, sun [0] = hours [7]
)
/

Statistics
———————————————————-
10 recursive calls
0 db block gets
184 consistent gets
1260 physical reads
0 redo size
1228664 bytes sent via SQL*Net to client
36900 bytes received via SQL*Net from client
3310 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
49635 rows processed

49635 rows selected.

Elapsed: 00:00:04.21

SQL> select weekno
2 , empno
3 , mon
4 , tue
5 , wed
6 , thu
7 , fri
8 , sat
9 , sun
10 from (
11 select weekno,empno,sum(decode(day,2,hours,0)) mon,
12 sum(decode(day,3,hours,0)) tue
13 ,sum(decode(day,4,hours,0)) wed
14 ,sum(decode(day,5,hours,0)) thu
15 ,sum(decode(day,6,hours,0)) fri
16 ,sum(decode(day,7,hours,0)) sat
17 ,sum(decode(day,7,hours,0)) sun from
18 worked_hours group by weekno,empno)
19 /

49635 rows selected.

Elapsed: 00:00:01.92

Statistics
———————————————————-
4 recursive calls
6 db block gets
184 consistent gets
272 physical reads
0 redo size
943540 bytes sent via SQL*Net to client
36900 bytes received via SQL*Net from client
3310 SQL*Net roundtrips to/from client
0 sorts (memory)
1 sorts (disk)
49635 rows processed

It seems that the old pivot method is better. It seems that the difference connect somehow to phiscal reads.
參考來源

2009年9月1日 星期二

指定button為enter的第一個觸發button

經常希望在登入頁的登入button為key完帳號,密碼後的按enter的第一個觸發button,可是如果在這個button之前有其他的button,那麼,預設的第一個button就會是整個頁面上的第一個,為了解決此問題,可將整頁用panel包起來設定DefaultButton="登入button name"即可讓登入的button為第一個觸發的按鈕.