62,046
社区成员
发帖
与我相关
我的任务
分享
public static ArrayList readPointId(string stationId ,string oracleConnStr)
{
ArrayList list = new ArrayList();
string sql = "select sit.instrcode,sit.pointid,it.instrtype from qzdata.qz_dict_stationinstruments sit,QZDATA.QZ_DICT_INSTRUMENTS it where sit.instrcode like'312%' and sit.stationid='" + stationId + "' and it.instrcode=sit.instrcode";
using (OracleConnection conn = new OracleConnection(oracleConnStr))
{
conn.Open();
using (OracleCommand cmd = new OracleCommand(sql, conn))
{
using (OracleDataReader dr = cmd.ExecuteReader())
{
while(dr.Read())
{
Point p = new Point();
p.InstrCode = dr.GetString(0);
p.PointId = dr.GetString(1);
p.InstrType = dr.GetString(2);
list.Add(p);
}
}
}
}
return list;
}
public class Point
{
private string instrCode;
private string pointId;
private string instrType;
public Point()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public string InstrCode
{
get { return instrCode; }
set { instrCode = value; }
}
public string PointId
{
get { return pointId; }
set { pointId = value; }
}
public string InstrType
{
get { return instrType; }
set { pointId = value; }
}
}
p.InstrCode = dr.GetString(0);
p.PointId = dr.GetInt32(1);
p.InstrType = dr.GetString(2);