摘要:
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 = 阅读全文
摘要:
// 公有方法,获取数据,返回一个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. 阅读全文