本文介绍了在选择事件时从下拉列表更新和删除.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个下拉列表.
dropdownlist显示(已接收,已取消,已删除)
我的一个数据库表中有一个字段名称状态.
我想更新数据库中的状态字段,方法是单击刚刚收到的或已取消的内容,并通过单击从组合框删除的内容来删除基于id的整行.
i have a dropdownlist.
dropdownlist is showing ( recieved ,Canceled ,Deleted)
i have a field name status in one of my database table.
i want to update my status field in database on clicking just recieved or Canceled and delete the entire row on the bases of id by clcing deleteted from combobox. how can i do it??
推荐答案
protected void ddlStatus_SelectedIndexChanged(object sender, EventArgs e)
{
int selection = ddlStatus.SeletedValue;
string query = string.Empty;
if (selection == 0)
{
//write your query
}
//database connection and execute the query
}
祝你好运.
Good luck.
这篇关于在选择事件时从下拉列表更新和删除.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!