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
林小蔚的異想空間
一個由理性與感性交織與衝擊出的思想與異想時間與空間
熱門文章
-
DECLARE @ID AS INT DECLARE @LastCust AS VARCHAR(50) DECLARE @LastReceiveTime AS DATETIME SET @ThisCust = ''
-
SELECT DISTINCT GroupField1, COUNT(*) AS CountField FROM SourceTableName GROUP BY GroupField1 HAVING COUNT(*) > 1 ORDER BY CountField
-
----以相同GroupField為組,依據SortField排序,並給予排名RANK SELECT RANK() OVER (PARTITION BY SourceTableName.GroupField ORDER BY SourceTableName1.SortField1...
-
DataTable,DataView和DataGrid中一些容易混淆的概念 一、DataTable DataTable表示內存中數據的一個表,它完全是在內存中的一個獨立存在,包含了這張表的全部信息。DataTable可以是從通過連接從數據庫中讀取出來形成的一個表,一旦將內容讀到D...
-
StrA + StrB
-
vb.net Private Sub PrintTableOrView(ByVal dv As DataView, ByVal label As String) Dim sw As System.IO.StringWriter Dim output As Stri...
-
--宣告Cursor的資料來源Table DECLARE vendor_cursor CURSOR FOR SELECT Field1, Field2, Field3 FROM SourceTableName WHERE Field4 IN ( SELECT DISTINCT ...
-
IF PATINDEX('%' + @pattern + '%', @Expression) = 0 找不到 IF PATINDEX('%' + @pattern + '%', @Expression) = 1 字串...
-
網路簡介與指令
-
IIS 6 iisapp /a DefaultAppPool /r c:\windows\system32\iisapp.vbs /a YourPoolName /r cscript.exe c:\windows\system32\iisapp.vbs /a YourPoolNa...
星期五, 10月 28, 2011
星期二, 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
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#
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
BORDERCOLOR=#333366 bgcolor="#FFFFFF">
Standard ASCII set, HTML Entity names, ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1 Browser support: All browsers | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
|
BORDERCOLOR=#333366 bgcolor="#FFFFFF">
HTML 4.01, ISO 10646, ISO 8879, Latin extended A and B, Browser support: Internet Explorer > 4, Netscape > 4 | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
|
星期四, 3月 31, 2011
SQL 字串index
IF PATINDEX('%' + @pattern + '%', @Expression) = 0 找不到
IF PATINDEX('%' + @pattern + '%', @Expression) = 1 字串位於第一個位置
IF PATINDEX('%' + @pattern + '%', @Expression) = 1 字串位於第一個位置
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)
)
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)
)
訂閱:
文章 (Atom)