摘要: public static void BindDropDownList2(string SqlString, DropDownList MyDDL, string TextStr, string ValueStr) { SqlDataReader MyReader = GetDataReader(SqlString); MyDDL.Items.Clear(); while (MyReader.Read()) { ListItem MyItem = new ListItem(); MyItem.Text = MyReader[TextStr].ToString(); MyItem.Value = 阅读全文
posted @ 2012-12-01 20:29 FiberHomer 阅读(1313) 评论(0) 推荐(0) 编辑
摘要: // 公有方法,获取数据,返回一个DataSet。 public static DataSet GetDataSet(string SqlString) { using (SqlConnection connection = new SqlConnection(ConnectionString)) { connection.Open(); using (SqlCommand cmd = new SqlCommand(SqlString, connection)) { using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { DataSet d. 阅读全文
posted @ 2012-12-01 20:19 FiberHomer 阅读(146) 评论(0) 推荐(0) 编辑