新聞中心
首先對(duì)于ADO.NET代碼要先保存起來(lái),當(dāng)下一次需要打開連接地時(shí)候就將先前地Connection 交給下一個(gè)連接。這就是ADO.NET代碼的編制,制定ADO.NET代碼的相關(guān)技巧。。

我們提供的服務(wù)有:網(wǎng)站制作、成都網(wǎng)站制作、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、侯馬ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的侯馬網(wǎng)站制作公司
如果您地項(xiàng)目是ASP.NET/WebService 我們會(huì)建議您運(yùn)用ADO.NET代碼因?yàn)檫@個(gè)功能可以幫助您減少由于頻繁創(chuàng)建連接帶來(lái)地巨大系統(tǒng)開銷。
如果您地系統(tǒng)是一個(gè)C/S模型結(jié)構(gòu),我們會(huì)不建議您運(yùn)用ADO.NET代碼,這是由于一般而言,在C/S這樣地模型中,每一個(gè)用戶均為運(yùn)用自己地用戶名密碼去連接后臺(tái)數(shù)據(jù)庫(kù),運(yùn)用地均為不同地Connection String,根本不會(huì)出現(xiàn)頻繁出現(xiàn)打開/關(guān)閉數(shù)據(jù)庫(kù)連接地問題。#t#
實(shí)際上在ADO.NET代碼模型中,您可以一直使一個(gè)Connection維護(hù)open地關(guān)閉,而不Close,這樣更可以提高您系統(tǒng)地性能,不會(huì)由于Connection Pool地額外檢查而帶來(lái)系統(tǒng)資源地消耗,相應(yīng)情況下也不必?fù)?dān)心一直打開地Connection長(zhǎng)時(shí)間地占用了連接,導(dǎo)致其他地連接無(wú)法從ADO.NET代碼及時(shí)獲取到。(因?yàn)槟揪筒恍枰\(yùn)用到connection pool)
另外地一點(diǎn)備住:
- Enlist (True)
- When true, the pooler automatically enlists the connection in the current transaction context of the creation thread if a transaction context exists.
- Max Pool Size (100)
- The maximum number of connections allowed in the pool.
- Min Pool Size (0)
- The minimum number of connections maintained in the pool.
- ConnectionReset (True)
- Gets or sets a Boolean value that indicates whether the connection is reset when drawn from the connection pool.
- The value of the ConnectionReset property or true if no value has been supplied.
- This property corresponds to the "Connection Reset" key within the connection string.
當(dāng)前文章:對(duì)于ADO.NET代碼編制與列表學(xué)習(xí)
網(wǎng)站地址:http://www.5511xx.com/article/ccedjhp.html


咨詢
建站咨詢
