悬赏园豆:10
[已关闭问题]
public IList <Model.zyk> GetList(string strWhere) <BR>{ <BR>StringBuilder strSql = new StringBuilder(); <BR> strSql.Append("select [zy_id],[fl_id],[zy_name],[carry_user]"); <BR> strSql.Append(" FROM 表"); <BR> if (strWhere.Trim() != "") <BR> { <BR> strSql.Append(" where " + strWhere); <BR> } <BR><BR> IList <Model.zyk> tinfos = new List <Model.zyk>(); <BR> using (SqlDataReader rdr = SqlHelper.ExecuteReader(SqlHelper.connectionString, CommandType.Text, strSql.ToString(), null)) <BR> { <BR> while (rdr.Read()) <BR> { <BR> Model.zyk tinfo = new Model.zyk(rdr.GetString(0), int.Parse(rdr.GetValue(1).ToString()), rdr.GetString(2), rdr.GetString(3)); <BR> tinfos.Add(tinfo); <BR> } <BR> } <BR> return tinfos; <BR>} <BR><BR>Model.zyk是一个实体类,包含一些属性 <BR><BR>现在如果根据条件取得记录后,我想绑定其中一个字段的值,该如何实现?
问题补充:
比如我想把字段zy_name 绑定在treeview的Text
叶子绿了
|
初学一级
|
园豆:
50
提问于:2008-04-18 10:46