對IDictionary進行操作是
value可以
通過公用方法得到信息(得到
public IDictionary ExecuteDictionary( IDbCommand iCmd )
{
IDataReader reader = null;
try
{
//只讀取一行數據
reader = iCmd
}
catch(Exception e)
{
this
return null;
}
IDictionary dict = null;
if(reader
{
int fieldCount = reader
dict = new SortedList( fieldCount );
for(int i =
{
dict [reader
}
}
reader
reader
return dict;
}
//返回list
public SortedList selectSingln()
{
DB
DB
return (SortedList)DB
}
//遍歷list
private void _BeginRun()
{
_SqlServerLogic logic = new _SqlServerLogic();
SortedList dic = logic
Hashtable hash = new Hashtable();
//遍歷sortlist
foreach(DictionaryEntry entry in dic)
{
Response
if( !string
{
hash
}
}
IDictionaryEnumerator item = hash
//遍歷Hashtable
while( item
{
Response
}
string [] ary = new string [dic
dic
Response
//for 遍歷list
for(int i =
{
Response
}
}
From:http://tw.wingwit.com/Article/program/ASP/201311/21751.html