Asp.net 如何使用Enterprise Library 5.0填充下拉列表
是否有使用Enterprise Library 5.0 DAAB填充下拉框的简单代码 我试过这个,但不起作用:Asp.net 如何使用Enterprise Library 5.0填充下拉列表,asp.net,enterprise-library,daab,data-access-app-block,Asp.net,Enterprise Library,Daab,Data Access App Block,是否有使用Enterprise Library 5.0 DAAB填充下拉框的简单代码 我试过这个,但不起作用: cmbOffice.DataSource = _db.ExecuteDataSet( CommandType.Text, "select office_id, office_name from office").Tables[0]; cmbOffice.DataBind(); cmbOffice.DataSource=_db.ExecuteDataSet(C
cmbOffice.DataSource = _db.ExecuteDataSet(
CommandType.Text,
"select office_id, office_name from office").Tables[0];
cmbOffice.DataBind();
cmbOffice.DataSource=_db.ExecuteDataSet(CommandType.Text,“从办公室中选择办公室id、办公室名称”)。表[0]。默认视图
cmbOffice.DataBind() 让我们试着让你的问题变得更好。企业库是具有不同用途的应用程序块的集合,那么您想做什么呢?您当前的问题仅适用于关闭-不是真正的问题。我想使用Enterprise LibrarycmbOffice.DataSource=\u db.ExecuteDataSet(CommandType.Text,“从办公室选择办公室id,办公室名称”)。表[0];cmbOffice.DataBind();我试过这个。不工作,我不是来打发时间的。试图解决一个问题。你能不能试着理解我的问题,而不是说“你现在的问题只适合近距离提问——不是一个真正的问题”@Vivek我相信,语言障碍正从两方面造成问题。企业库包含许多部分。如果不知道你所说的是哪一部分,任何人都不能提供错误。我想你希望使用DAAB。使用此信息更新您的问题。
DataSet ds = _db.ExecuteDataSet(
CommandType.Text,
"select office_id, office_name from office");
cmbOffice.DataSource = ds;
cmbOffice.DataValueField= "office_id";
cmbOffice.DataTextField = "office_name";
cmbOffice.DataBind();