runxinzhi.com
首页
百度搜索
由错误的方法中得到的
- -!今天做了件糊涂事,居然忘记用sp来直接cross表格来取值。不过由此也得到一个方法:
private
struct
SLocation
{
public
string
name;
public
int
ID;
}
private
ArrayList GetLocationArrayList()
{
if
(
this
._dsLocation.Tables.Count
<=
0
)
{
this
._dsLocation
=
this
._loc.GetLocationList();
}
DataTable _dt
=
this
._dsLocation.Tables[
0
];
ArrayList _al
=
new
ArrayList();
SLocation _stcloc
=
new
SLocation();
foreach
(DataRow _dr
in
_dt.Rows)
{
_stcloc.ID
=
Convert.ToInt32(_dr[
"
LOCATION_ID
"
]);
_stcloc.name
=
_dr[
"
LOCATION_NAME
"
].ToString();
_al.Add(_stcloc);
}
return
_al;
}
private
String GetLocationNameByID(
int
ID)
{
if
(
this
._alLocation.Count
<=
0
)
{
this
._alLocation
=
this
.GetLocationArrayList();
}
IEnumerator _emun
=
_alLocation.GetEnumerator();
SLocation _stcloc
=
new
SLocation();
String _locName
=
string
.Empty;
for
(
int
i
=
0
;i
<
_alLocation.Count
-
1
;i
++
)
{
_emun.MoveNext();
_stcloc
=
(SLocation)_emun.Current;
if
(_stcloc.ID
==
ID)
{
_locName
=
_stcloc.name;
break
;
}
}
return
_locName;
}
先声明一个结构,再将结构做为object放入arraylist.
over
愿一路奔跑不退缩,到目前一直从事.Net的B/S,C/S企业应用研发
相关阅读:
Prime Land(poj 1365)
备用交换机(cogs 8)
救命(洛谷 U4525)
消息传递(cogs 1001)
SQLite 使用主键,ROWID 及自增列
SqlHelper 类
一个继承的 DataGridView
给JAVA的eclipse IDE 在线安装 SVN插件 / 给 eclipse 添加打开所在的文件夹功能
实时更新DataGridView 合计值
导出为文本格式
原文地址:https://www.cnblogs.com/syveen/p/189271.html
最新文章
匿名函数
PHP闭包
理解 PHP 依赖注入
mvc框架路由原理
MySQL注入与防御
HDU 1028 Ignatius and the Princess III 整数的划分问题(打表或者记忆化搜索)
HDU 1027 Ignatius and the Princess II(求第m个全排列)
hdu 1026 Ignatius and the Princess I(BFS+优先队列)
HDU 1022 Train Problem I(栈的操作规则)
hdu 1021 Fibonacci Again(变形的斐波那契)
热门文章
HDU 1019 (多个数的最小公倍数)
HDU 1018Big Number(大数的阶乘的位数,利用公式)
HDU 1017A Mathematical Curiosity (暴力统计特殊要求个数)
HDU 1016 Prime Ring Problem(素数环问题)
苹果树(codevs 1228)
超级钢琴(codevs 2934)
中庸之道(codevs 2021)
过河(codevs 1155)
算(tyvjP4700)
Minimum Sum LCM(uva 10791)
Copyright © 2020-2023
润新知