如何将动态单选按钮选择的值发送到数据库 [英] how to send dynamic radio button selected value to database

查看:68
本文介绍了如何将动态单选按钮选择的值发送到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在从数据库中获取一些值...为此我使用了单选按钮...当我选择特定的单选按钮时特定的信息应进入数据库...请给我一个主意



i am fetching some values from database...for that i used radio button...when i select the particular radio button that particular information should go to the database...please give me a piece of idea

推荐答案


如果创建了单选按钮,则仅在CheckedChanged事件上,从选定的单选按钮捕获想要的内容(标签,文本等),然后保存:

Hi,
If you have created you radiobutton, then, just on CheckedChanged event, capture what ever you want(Tag, Text,...) from the selected radiobutton, and go for saving:

private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
    RadioButton radio = (RadioButton)sender;
    string text = radio.Text;
    string tag = radio.Tag;
    //TODO
    //Save into database
}



我的表单上有一个单选按钮.

希望对您有帮助,
干杯



I have a radionbutton on my form.

I hope it helps,
Cheers


这篇关于如何将动态单选按钮选择的值发送到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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