本文介绍了如何将数据插入动态表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要解释一下我的概念.
我有一个下拉列表和一个动态表...
当我在下拉列表中选择时,我希望根据下拉列表中的选定值在动态表中更改数据...以及如何将数据库链接到表....
I''l explain u my concept..
I have a dropdownlist and a dynamic table...
when i select in dropdownlist i want data to be changed in dynamic table according to the selected value in dropdown... and also how to link database to the table....
推荐答案
private void cmbDropDownBox_SelectionIndexChanged()
{
string myStr = "";
if(cmbDropDownBox.SelectedIndex != -1)
{
if(cmbDropDownBox.Text == "Assigned")
{
//Fire The Query For Status = "Assigned"
myStr = "SELECT * FROM YourTableName WHERE Status = '" + cmbDropDownBox.Text + "'";
//Store The Data Into the Datatable
//And From the Datatable, display it into your grid
}
else if(cmbDropDownBox.Text == "Not Assigned")
{
//Fire The Query For Status = "Not Assigned"
myStr = "SELECT * FROM YourTableName WHERE Status = '" + cmbDropDownBox.Text + "'";
//Store The Data Into the Datatable
//And From the Datatable, display it into your grid
}
}
}
希望你能从中得到一个主意...
Hope You Will Get An Idea Through This...
这篇关于如何将数据插入动态表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!