2007-12-31

新的一年

2008,第27个年头
多些行动,将是不一样的第一步。

早安,2008
明天再见~!

2007-12-27

Using Transactions.TransactionScope

Trying to do with: running Using scope As Transactions.TransactionScope = New Transactions.TransactionScope() in vs 2005 pro by vb.net
Searched by: TransactionScope imports
Source from: http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic59025.aspx


"Namespace or type specified in the imports 'System.Transactions' doesn't contain any public member or cannot be found. Make sure then namespace... etc."

When I visit the properties of the project and check the available references I can't find it there either. Do I have to do something extra before using that Namespace?


If you are using Visual Studio 2005 Standard Editon & above do the following
Right click on the project
Add Reference
you'll definitely see reference System.Transaction under .NET references in
the references tab.

MSDTC on server is unavailable.

Trying to do with: running Using scope As Transactions.TransactionScope = New Transactions.TransactionScope() in vs 2005 pro by vb.net
Searched by: MSDTC on server is unavailable
Source from: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54705




[*]

On the server where the trigger resides, you need to turn the MSDTC service on. You can this by clicking START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES. Find the service called 'Distributed Transaction Coordinator' and RIGHT CLICK (on it and select) > Start.

Test the trigger and see if it works. If it still does not work, wrap you trigger in the following transaction code (found below in bold):


SET XACT_ABORT ON
BEGIN DISTRIBUTED TRANSACTION


-- Put all queries in here (SELECT, INSERT, UPDATE, and DELETE)
select * from [SERVER2].[DBASE].[OWNER].[TABLENAME]
update [SERVER2].[DBASE].[OWNER].[TABLENAME]
set [column] = value
where [condition(s)]

COMMIT TRANSACTION
SET XACT_ABORT OFF



This solution solved our problems, I hope they solve yours.
We ran into the following errors, and the above fixed them:
1. MSDTC on server is unavailable. [fixed this error by started the service above [*] ]
2. Server: Msg 7395, Level 16, State 2, Procedure name, Line 26
Unable to start a nested transaction for OLE DB provider 'SQLOLEDB'. A nested transaction was required because the XACT_ABORT option was set to OFF.
[OLE/DB provider returned message: Cannot start more transactions on this session.]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionLocal::StartTransaction returned 0x8004d013: ISOLEVEL=4096].

2007-12-20

msn nick

☑爱自己
☐Rich
LoL ~~ o(∩_∩)o...

2007-12-19

DateTimePicker vb.net 2005 bindingsource

These will cause error:
  1. DateTimePicker.value = DateTime.Now().ToString("yyyy-MM-dd dddd hh:mm:ss tt")
  2. DateTimePicker.value = Format(Now, "yyyy-MM-dd dddd hh:mm:ss tt")
if assign value to any components(comboBox.selectedIndex, DateTimePicker.value) within constructor New() body, after form those assigned value don't work as expected.

fixed by: assign value within form_load body.

2007-12-11

sql server functions

SQL Server 2000

There are three types of UDF in Microsoft SQL Server 2000:

  1. Scalar functions.
  2. Inline table-valued functions.
  3. Multistatement table-valued functions.

Scalar functions return a single data value (not a table) with RETURNS clause. Scalar functions can use all scalar data types, with exception of timestamp and user-defined data types. Inline table-valued functions return the result set of a single SELECT statement. Multistatement table-valued functions return a table, which was built with many TRANSACT-SQL statements.

User-defined functions can be invoked from a query like built-in functions such as OBJECT_ID, LEN, DATEDIFF, or can be executed through an EXECUTE statement like stored procedures.

2007-12-10

The Structure of Stored Procedures

The Structure of Stored Procedures
(from SQL SERVER 2000 Stored Procedure Programming)

We will pause aminute to explain the structure of a stored procedure.
A stored procedure encapsulates a relatively simple Select statement for later use.
It returns a recordset containing values from the Selected column.

The recordset will contain only records that matched with the WHERE statement.

The code of a stored procedure consists of a header and a body.

The header of the stored procedure defines external attributes of the stored procedure—its name and a list of one or more parameters.

A example stored procedure has two parameters.
Parameter names must start with the @ character.
The developer must also define a datatype for each parameter.
The header must begin with the Create Procedure keyword and finish with the As keyword.

The body of the stored procedure contains the Transact-SQL statements to be executed when the stored procedure runs.

In this example, there is just one Select statement using the procedure parameters.

2007-12-03

钻石水机用户,是真是假,有关当局快快帮帮忙。

Cz: 钻石水机用户,是真是假,有待你的医生从你的医药报告 一一告知以你

有線新聞踢爆鑽石能量水廣告
http://www.youtube.com/watch?v=-NkHV0a10Do


鑽石水機用戶,請立刻驗腎!!!
請立刻轉寄給所有鑽石水機用戶,功德無量!!!

鑽石水機用戶感染腎小球腎炎 - 李小姐 32 歲,每年都有例行全身檢驗的習慣,
2006 年 2 月,李小姐安裝了一台鑽石水機,開始生飲過瀘後的水,
2006 年4月作例行全身檢驗時發覺感染了腎小球腎炎,腎功能開始衰退。

據知馬來西亞,新加坡和香港已有多人受感染。 鑽石水機大腸桿菌嚴重超標

鑽石水機用戶陳先生,2006 年6月安裝了一台鑽石水機,開始生飲過瀘後的水,
感到
身體不適,每天肚瀉多次,代理解釋為好轉反應,陳先生不放心,
於是自行把過瀘後
的水交化驗所化驗,結果是大腸桿菌嚴重超標。
陳先生於是立刻退機。


Cz: 有关当局快帮帮忙,别让你忠实的用户,过于担心。
好的产品当然不怕考验,希望这一封转邮,纯属恶搞。
要不然,受害者多得是啊~

p/s:查证后,将有详细的讯息 将陆续上载~

new function of blogger



today, new function from blogger.

Write. Share. Post.
Post to Blogger from Google Docs & Spreadsheets.

friendster vs facebook


trend of customizing for friendster steping after facebook.

few days back, friendster launched something which is similiar with facebook.

2007-11-30

From - An.Inconvenient.Truth.2006.

From “An.Inconvenient.Truth.2006.”

Learn as much as you can about the climate crisis.
Then put your knowledge into action. www.climatecrisis.net

2007-11-29

vb.net time format string.

CodesOutput
Format(Now, "h")System.FormatException was unhandled
Input string was not in a correct format.
FormatDateTime(Now, DateFormat.ShortTime)19:36 (in 24 hour)
DateTime.Now.ToString("h")
or
Now.ToString(" h")
7 (in 12 hour)
Now.Hour.ToString(" h")h (not appear figure in hour)

转:hottest forum in china

http://www.tianya.cn/
[5:32:27 PM] Gwyneth Tham says: iit's one of the hottest forum in china nowadays
[5:32:27 PM] Gwyneth Tham says: it has lots of forums for lots of topics

Formatting Dates and Times

Formatting Dates and Times

A format string for date/time values can use one of the predefined string values shown in the following table.

StringDescription
Long DateDDisplays a date in long date format.
Short DatedDisplays a date in short date format.
Long TimeTDisplays a date in long date format.
Short TimetDisplays a date in short date format.
FDisplays the long date and long time.
fDisplays the long date and short time.
gDisplays the short date and short time.
MmDisplays the month and the day of a date.
YyFormats the date as the year and month.






Examples of applying a format string to date/time values are shown in the following table.

FormatOutput
Format(Now,"D")Thursday, November 29, 2007
Format(Now,"d")11/29/2007
Format(Now,"T")3:20:02 AM
Format(Now,"t")3:20 AM
Format(Now,"F")Thursday, November 29, 2007 3:20:02 AM
Format(Now,"f")Thursday, November 29, 2007 3:20 AM
Format(Now,"g")11/29/2007 3:20 AM
Format(Now,"m")November 29
Format(Now,"y")November, 2007

kitten for adoption




















Born/Found on 2007 Nov 25
Photo took on 2007 Nov 27

Bio status:
- healthy
- eyes still closing
- milk feeding

if any one interested, pls contact me before too late.


Open Adoption Closed on 2007 Nov 30.

TypeInitializationException was unhandled


Public g_sptCompany As new clsCompany

fixed by:
Public g_sptCompany As clsCompany
g_sptCompany = new clsCompany

Then VS2005 show me in the clsCompany constructor have some errors in VS2005 errors list, then easy to fix.

2007-11-24

Editing guide for private battlenet server of Warcraft III.

well...,
just simply a lousy guide for editing private battlenet server of warcraft III,
will keep update ya.

(assuming your copy of Warcraft III in pc is installed, able to play in single player and LAN,
and u able to connected to official battlenet servers,
but could not login due to id and password)

Tools: BNetGatewayEditor.exe
version: 2.0.3.1.
(perfer this version's flexibilities)
Url: http://track.eurobattle.net/
browser: any will do.
(any will do)


To be continue...

different of beginning and ending.

friendster Shoutout:

"~=~N0body cAn g0 baCk and staRt a nEw begiNning, but any0ne can sTart t0day and mAke a new ending."~=~"

2007-11-21

朋友是啥?

from evapink@msn:

朋友就是被你看透了 還能喜歡你的人。

Cz: 学习找朋友的当儿,也应当学习如何成为别人的朋友吧~

2007-11-20

转:是真是假,如何查证呢?

Fw: must read

有個朋友,在一次烤肉聚會當中絆倒了,摔了一跤,旁邊的朋友建議找醫護人員,但她很確定自己沒事, 只是穿了新鞋被磚塊絆了一下罷了。她還有點危危顫顫站立不穩的時候,朋友們幫她清洗乾淨,又為她盛了一盤食物, 她就跟著大家一起享受接下來的時光了。

她的先生後來打電話通知大家,她被送到醫院,傍晚六點,就過世了,原因是她在烤肉聚餐的時候中風。如果他們懂得辨識 中風的癥兆,她現在也許還跟我們在一起。有些人不會死,但結局處於無助無望的景況中。

只需要花一分鐘的時間讀完這篇文章,腦神經外科醫師說,如果他能在三 小時之內接觸到中風患者,他就可以將中風的後果完全扭轉過來。訣竅就是辨識診斷出中風的問題,並讓病患在三小時之內接受醫療,而這是很難的。

辨識中風感謝 上帝讓我們記住 STR 三步驟,請閱讀並學習 !
有時候中風的癥兆很難辨認,不幸的是,缺乏警覺就會帶來災難。身邊的人辨認不出中風的徵兆,中風患者就會嚴重腦傷。醫生說,旁人只要問三個簡單的問題, 就可以辨識中風:

S : (smile) 要求患者笑一下
T : (talk) 要求患者說一句簡單的句子(要有條理,有連貫性),
例如:今天天氣晴朗。
R : (raise) 要求患者舉起雙手注意:


另外一項中風癥兆是: 要求患者伸出舌頭 ,如果舌頭「彎曲」或偏向一邊,那也是中風的徵兆。

上面四個動作,患者如果有任何一個動作 做不來, 就要立刻打 999!!!
並且把症狀描述給接線者聽。
心臟科醫師說,收到這封電函的人, 若能將它轉寄給 10 個人, 就至少可以救一條命。

Cz:是真是假,如何查证呢?唯有记在脑力,别等要派上用场时,记不着。。。那就无法查证了咯~

Google Referrals