表有两列A,B
怎么在选择A列(下拉框)中数据时,B列显示相应的内容
比如,A中有学生a,但选择a时,B列显示学生a,出生于...,即相关描述
此描述为针对A中数据的,可以在程序中写
怎么在选择A列(下拉框)中数据时,B列显示相应的内容
比如,A中有学生a,但选择a时,B列显示学生a,出生于...,即相关描述
此描述为针对A中数据的,可以在程序中写
解决方案 »
- 一个小问题
- 生成随机数并写入数据库,请各位进来指点一下,哪里的问题?---先谢谢了
- [=============]循环 获取 控件的值
- 【鼠标看不见,实际上还在那 只不过透明化而已】 这种效果怎么实现?
- 请问 c#中如何把dataset数据以excel的格式保存到服务器
- 大家来看看这个微软的认证题目
- Com控件在安装后进行注册的问题
- 再出100分求解 两个内网通过外网连接问题,急
- 图像存为流的问题
- 请各位高手帮忙解决关于DataGrid控件的问题,,小弟将重分感谢!
- windows服务程序,怎样按时间段执行?
- [续]双击打开exe程序和System.Diagnostics.Process.Start(@"c:\xxx.exe")的区别问题发现:win7权限问题
然后 select b from table where key=“key”这样就取到B了 你想怎么处理就怎么处理呗?
这是我写的部分代码
private void AfterRowColChange(object sender, EventArgs e)
{
object[] args = new object[] { "学生1", "学生2", "学生3" };
string flag = this.student.Rows[0]["A"].ToString();
switch (flag)
{
case "1":
this.student.Rows[0]["B"] = args[0];
break;
case "2":
this.student.Rows[0]["B"] = args[1];
break;
case "3":
this.student.Rows[0]["B"] = args[2];
break;
}
}
我要的是A中数据选择时,比如选1,B列自动显示 学生1 的描述,而不是从表中去读
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlLB" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddlLB_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="ddlChild" runat="server" Width="20%">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</div>
protected void ddlLB_SelectedIndexChanged(object sender, EventArgs e)
{
if(this.ddlLB.SelectedValue!=null)
{
BindChild(this.ddlLB.SelectedValue);
}
}DropDownList2.DataSource=lst;
DropDownList2.DataValueField="name";
DropDownList2.DataTextField="name";
DropDownList2.DataBind();
{
object[] args = new object[] { "一级公司", "二级公司", "三级公司" };
string flag = "";
dictReference1.SelectedValue = flag;
if (this.dictReference1.SelectedValue != null)
{
switch (flag)
{
case "甘肃金轮文化传媒有限公司武威分公司":
this.ps_perm.Rows[0]["SLEVELDESC"] = args[0];
break;
case "2":
this.ps_perm.Rows[0]["SLEVELDESC"] = args[1];
break;
case "3":
this.ps_perm.Rows[0]["SLEVELDESC"] = args[2];
break;
}
}
}这样行吗?
{
if (this.dictReference1.SelectedValue != null)
{
string flag = "";
flag = dictReference1.SelectedValue;
switch (flag)
{
case "2LA110260Q":
this.yytdictGrid1.Grid.Rows[i]["SLEVELDESC"] = args[0];
break;
case "2":
this.yytdictGrid1.Grid.Rows[i]["SLEVELDESC"] = args[1];
break;
case "3":
this.yytdictGrid1.Grid.Rows[i]["SLEVELDESC"] = args[2];
break;
}
}
}怎么在加载的时候列名也该了呢?只要列的数据变咋整?