标签:SQ orm value text sql items class this 字段
string sql_ch = string.Format("select C_ID,C_name from T_Channel"); DataTable dt_ch = DBUtility.DbHelperSQL.Query(sql_ch).Tables[0]; if (dt_ch != null && dt_ch.Rows.Count > 0) { for (int i = 0; i < dt_ch.Rows.Count; i++) { string strText = "[" + dt_ch.Rows[i]["C_ID"].ToString() + "]" + dt_ch.Rows[i]["C_name"].ToString(); string strValue = dt_ch.Rows[i]["C_ID"].ToString(); ; ListItem listItem = new ListItem { Text = strText, Value = strValue }; this.DropDownList1.Items.Add(listItem); } }
标签:SQ orm value text sql items class this 字段
原文地址:https://www.cnblogs.com/njy888888/p/9083737.html