我有一个组合框和桌子 [英] i have a combobox and table

查看:59
本文介绍了我有一个组合框和桌子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在表a中有月份列,假设月份= jan并且我在组合框中选择值为jan,那么它将显示它已经在表格中

解决方案

1。创建一个获取组合框选定值并检查表格的函数。



2.在combobox1_SelectedIndexChanged事件上调用此方法



希望它有所帮助:)


如果你想显示当前月份,那么就像下面那样

YourComboBoxName.SelectedValue = DateTime.Now.Month;

如果你想在数据库框中显示当前月份,请按照以下步骤进行操作

YourComboBoxName.SelectedValue =从tblMonth中选择月份,其中month = DateTime.Now.Month ;

in table a have column of month , suppose month = jan and i have select in combobox value is jan, then it will display it is already in table

解决方案

1. Create a function which takes the combobox selected value and checks in the table.

2. Call this method on combobox1_SelectedIndexChanged event

Hope it helps :)


If you want to show current month then do like below
YourComboBoxName.SelectedValue = DateTime.Now.Month;
If you want to show the current month in your combo box from database then do like below
YourComboBoxName.SelectedValue=select month from tblMonth where month=DateTime.Now.Month;


这篇关于我有一个组合框和桌子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆