遍历表yaowu,获得有异名的所有药以及其异名
DataClass dc = new DataClass();//dataclass为自定义类,包含多种数据操作
string sql = "select * from yaowu";
SqlDataReader reader = dc.ReturnDataReader(sql);
ArrayList alNames = new ArrayList();
while (reader.Read())
{
ArrayList al = new ArrayList();
string[] names = reader["ym"].ToString().Split(new char[] { ' ' });
foreach(string name in names)
{
if (name!="")
al.Add(name);//放置各种异名
}
al.Add(reader["mc"].ToString());//放置正名
alNames.Add(al);//整条记录加进alNames数组