扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:刘彦青编译 来源:天极开发者网络 2007年11月8日
关键字: Windows
#code private DataSet data; #end code |
#code private void BindData() { data = new DataSet(); SqlConnection cnn = new SqlConnection("Data Source=(local);Initial Catalog=pubs;Integrated Security=SSPI"); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand("SELECT stor_id, stor_name,stor_address, city, state, zip FROM stores", cnn); adapter.Fill(data, "stores"); storeList.DataSource = data; storeList.DataMember = "stores"; storeList.DataTextField = "stor_name"; storeList.DataBind(); Session.Add("Data", data); } #end code |
#code private void Page_Load(object sender, System.EventArgs e) { if(!Page.IsPostBack) { BindData(); } } #end code |
#code public class StoreSelectorCommandEventArgs { private string _stor_id; private string _stor_name; private string _stor_address; private string _city; private string _state; private string _zip; public StoreSelectorCommandEventArgs(string stor_id, string stor_name, string stor_address, string city, string state, string zip) { _stor_id = stor_id; _stor_name = stor_name; _stor_address = stor_address; _city = city; _state = state; _zip = zip; } public string stor_id{ get{ return _stor_id; } } public string stor_name{ get{ return _stor_name; } } public string stor_address{ get{ return _stor_address; } } public string city{ get{ return _city; } } public string state{ get{ return _state; } } public string zip{ get{ return _zip; } } } #end code |
#code public delegate void StoreSelectorCommandEventHandler(object sender, StoreSelectorCommandEventArgs e); #end code |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者