单选按钮值传递到数据库 [英] Radio Button values passing to database

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

问题描述

大家好,

我有一个单选按钮,名称为有效".如果选中活动",我想在数据库中存储值"1";如果未选中,我想在数据库中存储"0".

谁能帮忙

Meenakshi

Hi All,

I have a Radio Button with name as "Active". If Active is checked i want to store value "1" in database, if unchecked i want to store "0" in database.

Can anyone help

Meenakshi

推荐答案

您可以尝试使用此方法.单选按钮的Enabled属性和Check value.

You can try this .Check Enabled Property of Radio Button and Check value .

Dim Active As Boolean
       Active = rdActive.Enabled
       Dim tpActive As Integer
       If (Active) Then
           tpActive = 1
       Else
           tpActive = 0
       End If



在插入查询中使用此tpActive



Use this tpActive in Insert Query


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

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