熱門文章

星期五, 10月 28, 2011

ASP.NET 連線字串加密

1: copy App.Config App.Config.original
2: rename App.config web.config
3: aspnet_regiis -pef connectionStrings . -prov DataProtectionConfigurationProvider
4: rename web.config App.config
感謝
http://dotnetprofessional.com/blog/post/2008/03/03/Encrypt-sections-of-WebConfig-or-AppConfig.aspx

星期二, 5月 17, 2011

DataTable DataView DataGrid中一些容易混淆的概念

DataTable,DataView和DataGrid中一些容易混淆的概念
一、DataTable
DataTable表示內存中數據的一個表,它完全是在內存中的一個獨立存在,包含了這張表的全部信息。DataTable可以是從通過連接從數據庫中讀取出來形成的一個表,一旦將內容讀到DataTable中,此DataTable就可以跟數據源斷開而獨立存在;也可以是完全由程序自己通過代碼來建立的一個表。

◆ DataColumn
一個表是由行和列組成的一個兩維的結構。表的結構是由DataColumn 對象的集合組成,DataColumn 對像集合可由DataTable.Columns 屬性中能獲取到,通過定義每一列的數據類型來確定表的架構,類似數據庫中定義表。定義完表的結構就可以根據結構來生成DataRow,用 DataTable.NewRow()方法來生成此DataTable結構的新行。 一個DataTable是由DataRow的集合組成的, DataRow的集合這個可以由DataTable.Rows 屬性來訪問。

DataTable還可以通過現有的列用Expression 屬性的表達式創建一些列。

1、創建計算出的列
比如:已經有了一個表結構,表中有一個DataColumn的集合,其中有一個叫UnitPrice的列,你可以新建一個DataColumn,設置好 ColumnName,再設置此列的表達式,DataColumn.Expression = "UnitPrice * 0.086",這個列的值就是名字為UnitPrice的列計算出來的,在創建表達式時,使用 ColumnName 屬性來引用列。

2、第二個用途是創建聚合列
聚合列聚合通常沿著關係執行(有關關係的描述見下面DataRelation部分),如果order表有名為 detail 的子表,兩個表之間通過order.orderid和detail.orderid兩個列建立一個關係 DataRelation 對像名為「order2detail」,在主表order中就可以建立一個聚合列,將計算每個order在detail表中含有的所有item的價格的和:DataColumn.Expression = 「sum(child(order2detail).price)",child(order2detail)表示通過關係order2detail聯繫到的子表,child(order2detail).price就表示子表的price列。

◆ DataRow
DataRow 對像沒有直接在代碼中使用的構造函數,一般是從具有一定結構的DataTable用NewRow()方法來新建一個DataRow對象。一個 DataRow根據其是獨立的,還是屬於某個DataTable,是否修改過,是否被DataTable刪除等等不同的情況有不同的狀態,由 DataRow.RowState屬性公開,如下表:

成員名稱 說明
Added 該行已添加到 DataRowCollection 中,AcceptChanges 尚未調用。
Deleted 該行已通過 DataRow 的 Delete 方法被刪除。
Detached 該行已被創建,但不屬於任何 DataRowCollection。
DataRow 在以下情況下立即處於此狀態:創建之後添加到集合中之前;或從集合中移除之後。
Modified 該行已被修改,AcceptChanges 尚未調用。
Unchanged 該行自上次調用 AcceptChanges 以來尚未更改。

一個DataRow對像剛被創建之後其狀態是Detached,是孤立的一個存在,所以建立了DataRow之後在DataRow中的單元填充了數據後還要通過DataTable.Rows.Add(DataRow)方法將此DataRow添加到DataTable,DataRow添加到DataTable 後, 這個DataRow的狀態就轉變為Added。當修改了這個DataRow後,這個DataRow狀態轉為Modified,當用 DataRow.Delete()方法刪除DataRow後,DataRow狀態將轉為Deleted,不過此行還存在在DataTable中的,只是狀態改變了,這時用DataTable.Rows.Count查看行數,跟刪除前是一樣的。只有在調用了DataTable.Remove (DataRow)方法後,此DataRow才被從DataTable移除,狀態也回復到Detached孤立狀態。
一旦調用了 DataTable.AcceptChanges()方法後,所有的行將根據不同的狀態做不同的處理,Added、Modified、Unchanged 將保留當前值,Deleted的行將從DataTable中移除,最後所有的行的狀態都置為Unchanged。當DataTable是從 DataAdapter.Fill(DataSet,DataTable)方法填充而形成的,Fill()方法將自動調用AcceptChanges()方法,將DataTable的行狀態都置為Unchanged。並且,如果Fill方法中指定的那個DataTable在要填充的那個DataSet不存在時,會生成一個跟數據源表同樣的結構的DataTable並填充數據。

◆ DataRelation
表示兩個 DataTable 對像之間的父/子關係。可以類比於數據庫中的表之間的關係,父表相當於關係列為主鍵的表,子表相當於關係列為外鍵的表。DataRelation 構造函數一般為:DataRelation(String, DataColumn, DataColumn) ,string為關係名,第一個DataColumn為建立關係的父表列,第二個DataColumn為建立關係的子表列,建立關係的兩個列的 DataType 值必須相同。
建立好了關係,必須把這個關係加入到DataTable的ParentRelations屬性或 ChildRelations 屬性,這兩個屬性包含這個表的所有的跟父表的關係和跟子表的關係。若關係中此表是父表則將此關係加入到ChildRelations集合中,否則加入到 ParentRelations集合中。

二、DataView
DataView表示用於排序、篩選、搜索、編輯和導航的 DataTable 的可綁定數據的自定義視圖。可以將DataView同數據庫的視圖類比,不過有點不同,數據庫的視圖可以跨表建立視圖,DataView則只能對某一個 DataTable建立視圖。DataView一般通過DataTable.DefaultView 屬性來建立,再通過通過RowFilter 屬性和RowStateFilter 屬性建立這個DataTable的一個子集。
RowFilter屬性用來篩選要查看DataTable中哪些行的表達式,這個表達式同上面所說的建立計算列的表達式相同。例如:"LastName = 'Smith'",這就是只查看列LastName的值為'Smith'的那些數據行。
RowStateFilter 屬性用來設置 DataView 中的行狀態篩選器,上面介紹DataRow時介紹了DataRow的狀態,一個DataRow可能有五種狀態,RowStateFilter就是可以通過這些狀態來篩選要查看的行集。其實DataRow不僅有五種狀態,DataRow還有版本的問題,比如當DataRow的狀態為Modified,即這行已經被修改了,這時這個DataRow就會有兩個版本,Current版本和Original版本(修改前的)。實際上RowStateFilter屬性是綜合了DataRow的狀態和版本來篩選的(RowStateFilter確省值是CurrentRows)見下表:

成員名稱 說明
Added 一個新行。
CurrentRows 包括未更改行、新行和已修改行的當前行。
Deleted 已刪除的行。
ModifiedCurrent 當前版本,原始數據(請參閱 ModifiedOriginal)的修改版本。
ModifiedOriginal 原始版本(儘管它後來已被修改並以 ModifiedCurrent 形式存在)。
None 無。
OriginalRows 包括未更改行和已刪除行的原始行。
Unchanged 未更改的行。
DataView.Count屬性得到的計數是在應用了 RowFilter 和 RowStateFilter 之後,獲取 DataView 中記錄的數量。
DataView 是建立在DataTable基礎上的,DataView.Table 屬性可以得到此DataView對應的那個DataTable。DataView的行叫DataRowView,可以從DataRowView直接通過 DataRowView.Row 屬性得到此DataRowView對應的DataRow。

三、DataGrid
這裡說的DataGrid是winform中的DataGrid,一般都是跟DataView綁定來顯示DataTable中的數據,和修改DataTable中的數據。
DotNet的DataGrid的功能強大,可是在使用上與以前的習慣不太一樣,有時還比較麻煩,所以很多人都對這個DataGrid感到有些摸不著頭腦,有一種無從下手的感覺,其實把一些概念搞清楚了許多問題就會迎刃而解了。

DataGrid 通過DataSource 和 DataMember 屬性來綁定其要顯示的數據源。數據源一般是DataTable、DataView、DataSet等,不過將這些數據源綁定到DataGrid時實際上是綁定的DataView。若數據源是DataTable時,實際上是綁定了此DataTable的DefaultView,若數據源是DataSet時,則可以向 DataMember 屬性設置一個字符串,該字符串指定要綁定到的表,然後再將DataMember指定的那個DataTable的DefaultView綁定到 DataGrid。
所以DataGrid實際顯示的是DataTable經過篩選的DataView。

感謝
http://ddddancer.blogspot.com/2007/10/datatabledataviewdatagrid.html

DataTable DataView Print 列印

vb.net
Private Sub PrintTableOrView(ByVal dv As DataView, ByVal label As String)
Dim sw As System.IO.StringWriter
Dim output As String
Dim table As DataTable = dv.Table

Console.WriteLine(label)

' Loop through each row in the view.
For Each rowView As DataRowView In dv
sw = New System.IO.StringWriter

' Loop through each column.
For Each col As DataColumn In table.Columns
' Output the value of each column's data.
sw.Write(rowView(col.ColumnName).ToString() & ", ")
Next
output = sw.ToString
' Trim off the trailing ", ", so the output looks correct.
If output.Length > 2 Then
output = output.Substring(0, output.Length - 2)
End If
' Display the row in the console window.
Console.WriteLine(output)
Next
Console.WriteLine()
End Sub

Private Sub PrintTableOrView(ByVal table As DataTable, ByVal label As String)
Dim sw As System.IO.StringWriter
Dim output As String

Console.WriteLine(label)

' Loop through each row in the table.
For Each row As DataRow In table.Rows
sw = New System.IO.StringWriter
' Loop through each column.
For Each col As DataColumn In table.Columns
' Output the value of each column's data.
sw.Write(row(col).ToString() & ", ")
Next
output = sw.ToString
' Trim off the trailing ", ", so the output looks correct.
If output.Length > 2 Then
output = output.Substring(0, output.Length - 2)
End If
' Display the row in the console window.
Console.WriteLine(output)
Next
Console.WriteLine()
End Sub

C#
private static void PrintTableOrView(DataView dv, string label)
{
System.IO.StringWriter sw;
string output;
DataTable table = dv.Table;

Console.WriteLine(label);

// Loop through each row in the view.
foreach (DataRowView rowView in dv)
{
sw = new System.IO.StringWriter();

// Loop through each column.
foreach (DataColumn col in table.Columns)
{
// Output the value of each column's data.
sw.Write(rowView[col.ColumnName].ToString() + ", ");
}
output = sw.ToString();
// Trim off the trailing ", ", so the output looks correct.
if (output.Length > 2)
{
output = output.Substring(0, output.Length - 2);
}
// Display the row in the console window.
Console.WriteLine(output);
}
Console.WriteLine();
}

private static void PrintTableOrView(DataTable table, string label)
{
System.IO.StringWriter sw;
string output;

Console.WriteLine(label);

// Loop through each row in the table.
foreach (DataRow row in table.Rows)
{
sw = new System.IO.StringWriter();
// Loop through each column.
foreach (DataColumn col in table.Columns)
{
// Output the value of each column's data.
sw.Write(row[col].ToString() + ", ");
}
output = sw.ToString();
// Trim off the trailing ", ", so the output looks correct.
if (output.Length > 2)
{
output = output.Substring(0, output.Length - 2);
}
// Display the row in the console window.
Console.WriteLine(output);
} //
Console.WriteLine();
}

感謝
http://msdn.microsoft.com/zh-tw/library/73kk32zz(v=vs.80).aspx#

星期二, 5月 10, 2011

HTML 特殊符號

感謝 http://ascii.cl/htmlcodes.htm



















































Standard ASCII set, HTML Entity names, ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1

Browser support: All browsers
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47



20
21
22
23
24
25
26
27

28
29
2A
2B
2C
2D
2E
2F




!
"
#
$
%
&
'

(
)
*
+
,
-
.
/


 
!
"
#

$
%
&
'

(
)
*
+


,
-
.
/




"




&













space
exclamation point
double quotes
number sign


dollar sign
percent sign
ampersand
single quote

opening parenthesis
closing parenthesis
asterisk
plus sign

comma
minus sign - hyphen
period
slash

































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


48
49
50
51
52
53
54
55

56
57
58
59
60
61
62
63



30
31
32
33
34
35
36
37

38
39
3A
3B
3C
3D
3E
3F



0
1
2
3
4
5
6
7

8
9
:
;
<
=
>
?


&#48;
&#49;
&#50;
&#51;

&#52;
&#53;
&#54;
&#55;

&#56;
&#57;
&#58;
&#59;


&#60;
&#61;
&#62;
&#63;

















&lt;

&gt;



zero
one
two
three


four
five
six
seven

eight
nine
colon
semicolon

less than sign
equal sign
greater than sign
question mark
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
79



40
41
42
43
44
45
46
47

48
49
4A
4B
4C
4D
4E
4F



@
A
B
C
D
E
F
G

H
I
J
K
L
M
N
O


&#64;
&#65;
&#66;
&#67;

&#68;
&#69;
&#70;
&#71;

&#72;
&#73;
&#74;
&#75;


&#76;
&#77;
&#78;
&#79;























at symbol



















































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
95



50
51
52
53
54
55
56
57

58
59
5A
5B
5C
5D
5E
5F



P
Q
R
S
T
U
V
W

X
Y
Z
[
\
]
^
_


&#80;
&#81;
&#82;
&#83;

&#84;
&#85;
&#86;
&#87;

&#88;
&#89;
&#90;
&#91;


&#92;
&#93;
&#94;
&#95;




































opening bracket


backslash
closing bracket
caret - circumflex
underscore
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


96
97
98
99
100
101
102
103


104
105
106
107
108
109
110
111


60
61
62
63
64
65
66
67


68
69
6A
6B
6C
6D
6E
6F


`
a
b
c
d
e
f
g

h
i
j
k
l
m
n
o


&#96;
&#97;
&#98;
&#99;


&#100;
&#101;
&#102;
&#103;

&#104;
&#105;
&#106;
&#107;

&#108;
&#109;
&#110;
&#111;
























grave accent

















































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


112
113
114
115
116
117
118
119


120
121
122
123
124
125
126
127


70
71
72
73
74
75
76
77


78
79
7A
7B
7C
7D
7E
7F


p
q
r
s
t
u
v
w

x
y
z
{
|
}
~



&#112;
&#113;
&#114;
&#115;


&#116;
&#117;
&#118;
&#119;

&#120;
&#121;
&#122;
&#123;

&#124;
&#125;
&#126;






































opening brace

vertical bar
closing brace
equivalency sign - tilde
(not defined in HTML 4 standard)

































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


128
129
130
131
132
133
134
135


136
137
138
139
140
141
142
143


80
81
82
83
84
85
86
87


88
89
8A
8B
8C
8D
8E
8F


































































(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)


(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)

(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)

(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


144
145
146
147
148
149
150
151

152
153
154
155
156
157
158
159



90
91
92
93
94
95
96
97

98
99
9A
9B
9C
9D
9E
9F



































































(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)

(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)

(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)


(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


160
161
162
163
164
165
166
167


168
169
170
171
172
173
174
175


A0
A1
A2
A3
A4
A5
A6
A7


A8
A9
AA
AB
AC
AD
AE
AF


 
¡
¢
£
¤
¥
¦
§

¨
©
ª
«
¬
­
®
¯


&#160;
&#161;
&#162;
&#163;


&#164;
&#165;
&#166;
&#167;

&#168;
&#169;
&#170;
&#171;

&#172;
&#173;
&#174;
&#175;



&nbsp;
&iexcl;
&cent;
&pound;

&curren;
&yen;
&brvbar;
&sect;

&uml;
&copy;
&ordf;
&laquo;

&not;
&shy;
&reg;
&macr;



non-breaking space
inverted exclamation mark
cent sign
pound sign

currency sign
yen sign
broken vertical bar
section sign

spacing diaeresis - umlaut
copyright sign
feminine ordinal indicator
left double angle quotes


not sign
soft hyphen
registered trade mark sign
spacing macron - overline
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


176
177
178
179
180
181
182
183


184
185
186
187
188
189
190
191


B0
B1
B2
B3
B4
B5
B6
B7


B8
B9
BA
BB
BC
BD
BE
BF


°
±
²
³
´
µ

·

¸
¹
º
»
¼
½
¾
¿


&#176;
&#177;
&#178;
&#179;


&#180;
&#181;
&#182;
&#183;

&#184;
&#185;
&#186;
&#187;

&#188;
&#189;
&#190;
&#191;



&deg;
&plusmn;
&sup2;
&sup3;

&acute;
&micro;
&para;
&middot;

&cedil;
&sup1;
&ordm;
&raquo;

&frac14;
&frac12;
&frac34;
&iquest;



degree sign
plus-or-minus sign
superscript two - squared
superscript three - cubed

acute accent - spacing acute
micro sign
pilcrow sign - paragraph sign
middle dot - Georgian comma

spacing cedilla
superscript one
masculine ordinal indicator
right double angle quotes


fraction one quarter
fraction one half
fraction three quarters
inverted question mark
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


192
193
194
195
196
197
198
199


200
201
202
203
204
205
206
207


C0
C1
C2
C3
C4
C5
C6
C7


C8
C9
CA
CB
CC
CD
CE
CF


À
Á
Â
Ã
Ä
Å
Æ
Ç

È
É
Ê
Ë
Ì
Í
Î
Ï


&#192;
&#193;
&#194;
&#195;


&#196;
&#197;
&#198;
&#199;

&#200;
&#201;
&#202;
&#203;

&#204;
&#205;
&#206;
&#207;



&Agrave;
&Aacute;
&Acirc;
&Atilde;

&Auml;
&Aring;
&AElig;
&Ccedil;

&Egrave;
&Eacute;
&Ecirc;
&Euml;

&Igrave;
&Iacute;
&Icirc;
&Iuml;



latin capital letter A with grave
latin capital letter A with acute
latin capital letter A with circumflex
latin capital letter A with tilde

latin capital letter A with diaeresis
latin capital letter A with ring above
latin capital letter AE
latin capital letter C with cedilla

latin capital letter E with grave
latin capital letter E with acute
latin capital letter E with circumflex
latin capital letter E with diaeresis


latin capital letter I with grave
latin capital letter I with acute
latin capital letter I with circumflex
latin capital letter I with diaeresis
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


208
209
210
211
212
213
214
215


216
217
218
219
220
221
222
223


D0
D1
D2
D3
D4
D5
D6
D7


D8
D9
DA
DB
DC
DD
DE
DF


Ð
Ñ
Ò
Ó
Ô
Õ
Ö
×

Ø
Ù
Ú
Û
Ü
Ý
Þ
ß


&#208;
&#209;
&#210;
&#211;


&#212;
&#213;
&#214;
&#215;

&#216;
&#217;
&#218;
&#219;

&#220;
&#221;
&#222;
&#223;



&ETH;
&Ntilde;
&Ograve;
&Oacute;

&Ocirc;
&Otilde;
&Ouml;
&times;

&Oslash;
&Ugrave;
&Uacute;
&Ucirc;

&Uuml;
&Yacute;
&THORN;
&szlig;



latin capital letter ETH
latin capital letter N with tilde
latin capital letter O with grave
latin capital letter O with acute

latin capital letter O with circumflex
latin capital letter O with tilde
latin capital letter O with diaeresis
multiplication sign

latin capital letter O with slash
latin capital letter U with grave
latin capital letter U with acute
latin capital letter U with circumflex


latin capital letter U with diaeresis
latin capital letter Y with acute
latin capital letter THORN
latin small letter sharp s - ess-zed
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


224
225
226
227
228
229
230
231


232
233
234
235
236
237
238
239


E0
E1
E2
E3
E4
E5
E6
E7


E8
E9
EA
EB
EC
ED
EE
EF


à
á
â
ã
ä
å
æ
ç

è
é
ê
ë
ì
í
î
ï


&#224;
&#225;
&#226;
&#227;


&#228;
&#229;
&#230;
&#231;

&#232;
&#233;
&#234;
&#235;

&#236;
&#237;
&#238;
&#239;



&agrave;
&aacute;
&acirc;
&atilde;

&auml;
&aring;
&aelig;
&ccedil;

&egrave;
&eacute;
&ecirc;
&euml;

&igrave;
&iacute;
&icirc;
&iuml;



latin small letter a with grave
latin small letter a with acute
latin small letter a with circumflex
latin small letter a with tilde

latin small letter a with diaeresis
latin small letter a with ring above
latin small letter ae
latin small letter c with cedilla

latin small letter e with grave
latin small letter e with acute
latin small letter e with circumflex
latin small letter e with diaeresis


latin small letter i with grave
latin small letter i with acute
latin small letter i with circumflex
latin small letter i with diaeresis
































ASCII HTMLHTML 
DecHexSymbolNumberNameDescription


240
241
242
243
244
245
246
247


248
249
250
251
252
253
254
255


F0
F1
F2
F3
F4
F5
F6
F7


F8
F9
FA
FB
FC
FD
FE
FF


ð
ñ
ò
ó
ô
õ
ö
÷

ø
ù
ú
û
ü
ý
þ
ÿ


&#240;
&#241;
&#242;
&#243;


&#244;
&#245;
&#246;
&#247;

&#248;
&#249;
&#250;
&#251;

&#252;
&#253;
&#254;
&#255;



&eth;
&ntilde;
&ograve;
&oacute;

&ocirc;
&otilde;
&ouml;
&divide;

&oslash;
&ugrave;
&uacute;
&ucirc;

&uuml;
&yacute;
&thorn;
&yuml;



latin small letter eth
latin small letter n with tilde
latin small letter o with grave
latin small letter o with acute

latin small letter o with circumflex
latin small letter o with tilde
latin small letter o with diaeresis
division sign

latin small letter o with slash
latin small letter u with grave
latin small letter u with acute
latin small letter u with circumflex


latin small letter u with diaeresis
latin small letter y with acute
latin small letter thorn
latin small letter y with diaeresis














BORDERCOLOR=#333366 bgcolor="#FFFFFF">










HTML 4.01, ISO 10646, ISO 8879, Latin extended A and B,

Browser support: Internet Explorer > 4, Netscape > 4































  HTMLHTML 
DecHexSymbolNumberNameDescription


338
339
352
353
376
402



152
153
160
161
178
192


Œ
œ
Š
š
Ÿ
ƒ


&#338;
&#339;
&#352;
&#353;


&#376;
&#402;











latin capital letter OE
latin small letter oe
latin capital letter S with caron
latin small letter s with caron

latin capital letter Y with diaeresis
latin small f with hook - function


































  HTMLHTML 
DecHexSymbolNumberNameDescription


8211
8212
8216
8217
8218
8220
8221
8222

8224
8225
8226
8230
8240
8364
8482



2013
2014
2018
2019
201A
201C
201D
201E

2020
2021
2022
2026
2030
20AC
2122






















&#8211;
&#8212;
&#8216;
&#8217;

&#8218;
&#8220;
&#8221;
&#8222;


&#8224;
&#8225;
&#8226;
&#8230;

&#8240;
&#8364;
&#8482;


















&euro;



en dash
em dash
left single quotation mark
right single quotation mark

single low-9 quotation mark
left double quotation mark
right double quotation mark
double low-9 quotation mark

dagger
double dagger
bullet
horizontal ellipsis
per thousand sign
euro sign
trade mark sign



星期四, 3月 31, 2011

SQL 字串index

IF PATINDEX('%' + @pattern + '%', @Expression) = 0 找不到
IF PATINDEX('%' + @pattern + '%', @Expression) = 1 字串位於第一個位置

SQL 字串相加

StrA + StrB

SQL Table種類

Local Temporary Tables #TempTable
Global Temporary Tables ##TempTable
Permanent Tables TableName
Table Variables @TempTable

CREATE TABLE #TempTable
(
id INT,
name VARCHAR(32)
)

CREATE TABLE ##TempTable
(
id INT,
name VARCHAR(32)
)

CREATE TABLE TableName
(
id INT,
name VARCHAR(32)
)

DECLARE @TempTableTABLE
(
id INT,
name VARCHAR(32)
)