473,757 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with radiobutton list control

code of my aspx page

<asp:RadioButto nList id="RadioButton List1"
runat="server"> </asp:RadioButton List>

now i want to bind data from database
Dim rsComm As SqlCommand

Dim rsReader As SqlDataReader

Dim strSql As String

Dim con As SqlConnection

con = New SqlConnection(" server=abc;UID= sa;PWD=sa;initi al
catalog=digicer tify")

con.Open()

strSql = "select certName from certDetail"

rsComm = New SqlCommand(strS ql, con)

rsReader = rsComm.ExecuteR eader

rsReader = rsReader

RadioButtonList 1.DataSource = rsReader

RadioButtonList 1.DataBind()

rsReader.Close( )

rsComm.Dispose( )

con.Close()

it makes radio buttons as no. of items selected but instead of displaying
certName as selected in query it displays

System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d

in front of each radio button
Nov 19 '05 #1
4 1317
RadioButtonList 1.DataTextField ="certName"

Eliyahu

"Ankit Aneja" <ef*****@newsgr oups.nospam> wrote in message
news:uO******** ******@TK2MSFTN GP12.phx.gbl...
code of my aspx page

<asp:RadioButto nList id="RadioButton List1"
runat="server"> </asp:RadioButton List>

now i want to bind data from database
Dim rsComm As SqlCommand

Dim rsReader As SqlDataReader

Dim strSql As String

Dim con As SqlConnection

con = New SqlConnection(" server=abc;UID= sa;PWD=sa;initi al
catalog=digicer tify")

con.Open()

strSql = "select certName from certDetail"

rsComm = New SqlCommand(strS ql, con)

rsReader = rsComm.ExecuteR eader

rsReader = rsReader

RadioButtonList 1.DataSource = rsReader

RadioButtonList 1.DataBind()

rsReader.Close( )

rsComm.Dispose( )

con.Close()

it makes radio buttons as no. of items selected but instead of displaying
certName as selected in query it displays

System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d
System.Data.Com mon.DbDataRecor d

in front of each radio button

Nov 19 '05 #2
Thanks for Eliyahu's input,

Hi Ankit,

As Eliyahu has mentioned, we can use the RadioButtonList .DataTextField and
DataValueField to specify which field from the DataSource Item we want to
bind. So in your scenario, there exist the "certName" column from the
database records, we can specify the RadioButtonList .DataTextField as the
"certName" so that the certName column's value will be bind as the
RadiobutotnList 's item's display value, (and it's the same for
DataValueField. ..)

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
--------------------
| From: "Eliyahu Goldin" <re************ *@monarchmed.co m>
| References: <uO************ **@TK2MSFTNGP12 .phx.gbl>
| Subject: Re: problem with radiobutton list control
| Date: Thu, 6 Oct 2005 09:33:35 +0200
| Lines: 64
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <e7************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 212.143.94.2
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1293 71
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| RadioButtonList 1.DataTextField ="certName"
|
| Eliyahu
|
| "Ankit Aneja" <ef*****@newsgr oups.nospam> wrote in message
| news:uO******** ******@TK2MSFTN GP12.phx.gbl...
| > code of my aspx page
| >
| > <asp:RadioButto nList id="RadioButton List1"
| > runat="server"> </asp:RadioButton List>
| >
| > now i want to bind data from database
| > Dim rsComm As SqlCommand
| >
| > Dim rsReader As SqlDataReader
| >
| > Dim strSql As String
| >
| > Dim con As SqlConnection
| >
| > con = New SqlConnection(" server=abc;UID= sa;PWD=sa;initi al
| > catalog=digicer tify")
| >
| > con.Open()
| >
| > strSql = "select certName from certDetail"
| >
| > rsComm = New SqlCommand(strS ql, con)
| >
| > rsReader = rsComm.ExecuteR eader
| >
| > rsReader = rsReader
| >
| > RadioButtonList 1.DataSource = rsReader
| >
| > RadioButtonList 1.DataBind()
| >
| > rsReader.Close( )
| >
| > rsComm.Dispose( )
| >
| > con.Close()
| >
| >
| >
| > it makes radio buttons as no. of items selected but instead of
displaying
| > certName as selected in query it displays
| >
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| >
| > in front of each radio button
| >
| >
|
|
|

Nov 19 '05 #3
thanks Steven
i was able to do it after Eliyahu's reply
"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:yi******** ******@TK2MSFTN GXA01.phx.gbl.. .
Thanks for Eliyahu's input,

Hi Ankit,

As Eliyahu has mentioned, we can use the RadioButtonList .DataTextField and
DataValueField to specify which field from the DataSource Item we want to
bind. So in your scenario, there exist the "certName" column from the
database records, we can specify the RadioButtonList .DataTextField as the
"certName" so that the certName column's value will be bind as the
RadiobutotnList 's item's display value, (and it's the same for
DataValueField. ..)

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
--------------------
| From: "Eliyahu Goldin" <re************ *@monarchmed.co m>
| References: <uO************ **@TK2MSFTNGP12 .phx.gbl>
| Subject: Re: problem with radiobutton list control
| Date: Thu, 6 Oct 2005 09:33:35 +0200
| Lines: 64
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <e7************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 212.143.94.2
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1293 71
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| RadioButtonList 1.DataTextField ="certName"
|
| Eliyahu
|
| "Ankit Aneja" <ef*****@newsgr oups.nospam> wrote in message
| news:uO******** ******@TK2MSFTN GP12.phx.gbl...
| > code of my aspx page
| >
| > <asp:RadioButto nList id="RadioButton List1"
| > runat="server"> </asp:RadioButton List>
| >
| > now i want to bind data from database
| > Dim rsComm As SqlCommand
| >
| > Dim rsReader As SqlDataReader
| >
| > Dim strSql As String
| >
| > Dim con As SqlConnection
| >
| > con = New SqlConnection(" server=abc;UID= sa;PWD=sa;initi al
| > catalog=digicer tify")
| >
| > con.Open()
| >
| > strSql = "select certName from certDetail"
| >
| > rsComm = New SqlCommand(strS ql, con)
| >
| > rsReader = rsComm.ExecuteR eader
| >
| > rsReader = rsReader
| >
| > RadioButtonList 1.DataSource = rsReader
| >
| > RadioButtonList 1.DataBind()
| >
| > rsReader.Close( )
| >
| > rsComm.Dispose( )
| >
| > con.Close()
| >
| >
| >
| > it makes radio buttons as no. of items selected but instead of
displaying
| > certName as selected in query it displays
| >
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| > System.Data.Com mon.DbDataRecor d
| >
| > in front of each radio button
| >
| >
|
|
|

Nov 19 '05 #4
Good. Glad that you've got it working.

Have a nice day!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
--------------------
| From: "Ankit Aneja" <ef*****@newsgr oups.nospam>
| References: <uO************ **@TK2MSFTNGP12 .phx.gbl>
<e7************ **@TK2MSFTNGP14 .phx.gbl>
<yi************ **@TK2MSFTNGXA0 1.phx.gbl>
| Subject: Re: problem with radiobutton list control
| Date: Thu, 6 Oct 2005 18:50:53 +0530
| Lines: 109
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <Oa************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: dsl-upwest-static-039.7.246.61.to uchtelindia.net
61.246.7.39
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1294 46
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| thanks Steven
| i was able to do it after Eliyahu's reply
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:yi******** ******@TK2MSFTN GXA01.phx.gbl.. .
| > Thanks for Eliyahu's input,
| >
| > Hi Ankit,
| >
| > As Eliyahu has mentioned, we can use the RadioButtonList .DataTextField
and
| > DataValueField to specify which field from the DataSource Item we want
to
| > bind. So in your scenario, there exist the "certName" column from the
| > database records, we can specify the RadioButtonList .DataTextField as
the
| > "certName" so that the certName column's value will be bind as the
| > RadiobutotnList 's item's display value, (and it's the same for
| > DataValueField. ..)
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > --------------------
| > | From: "Eliyahu Goldin" <re************ *@monarchmed.co m>
| > | References: <uO************ **@TK2MSFTNGP12 .phx.gbl>
| > | Subject: Re: problem with radiobutton list control
| > | Date: Thu, 6 Oct 2005 09:33:35 +0200
| > | Lines: 64
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| > | Message-ID: <e7************ **@TK2MSFTNGP14 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: 212.143.94.2
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1293 71
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | RadioButtonList 1.DataTextField ="certName"
| > |
| > | Eliyahu
| > |
| > | "Ankit Aneja" <ef*****@newsgr oups.nospam> wrote in message
| > | news:uO******** ******@TK2MSFTN GP12.phx.gbl...
| > | > code of my aspx page
| > | >
| > | > <asp:RadioButto nList id="RadioButton List1"
| > | > runat="server"> </asp:RadioButton List>
| > | >
| > | > now i want to bind data from database
| > | > Dim rsComm As SqlCommand
| > | >
| > | > Dim rsReader As SqlDataReader
| > | >
| > | > Dim strSql As String
| > | >
| > | > Dim con As SqlConnection
| > | >
| > | > con = New SqlConnection(" server=abc;UID= sa;PWD=sa;initi al
| > | > catalog=digicer tify")
| > | >
| > | > con.Open()
| > | >
| > | > strSql = "select certName from certDetail"
| > | >
| > | > rsComm = New SqlCommand(strS ql, con)
| > | >
| > | > rsReader = rsComm.ExecuteR eader
| > | >
| > | > rsReader = rsReader
| > | >
| > | > RadioButtonList 1.DataSource = rsReader
| > | >
| > | > RadioButtonList 1.DataBind()
| > | >
| > | > rsReader.Close( )
| > | >
| > | > rsComm.Dispose( )
| > | >
| > | > con.Close()
| > | >
| > | >
| > | >
| > | > it makes radio buttons as no. of items selected but instead of
| > displaying
| > | > certName as selected in query it displays
| > | >
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | > System.Data.Com mon.DbDataRecor d
| > | >
| > | > in front of each radio button
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
7871
by: William Gill | last post by:
I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep references to them in a 2 dimensional list ( rBtns ). It works fine, and I can even make it so only one button per column can be selected, by assigning each column to an intVar. In many languages a radiobutton has a property that can be directly read to see if it is selected on unselected. Tkinter radiobuttons don't seem to have any such property. Is there any way to...
2
2452
by: Abhishek Srivastava | last post by:
Hello All, I have bound an ArrayList to a repeater control. When the list is displayed, I want the the user to be able to choose one of the items in the list and then continue working. To achieve this I have done the following <asp:Repeater id='rep1' runat='server'> <HeaderTemplate> <table>
4
1397
by: Saber | last post by:
I have a web application and we had nice days, I don't know why I installed ..netframework sp1 and then a strange error happend: Control 'rdPoll_0' of type 'RadioButton' must be placed inside a form tag with runat=server. Actually, there is no rdPoll_0 in application, but there is rdPoll: Protected WithEvents rdPoll As System.Web.UI.WebControls.RadioButtonList
8
2927
by: johnmmcparland | last post by:
Hi all, my program is trying to add group boxes with radio buttons at run time. While at one point it was able to draw the group boxes without the radio buttons, now it encounters problems just getting the radiobuttons out of the group box. /// area where radio buttons added to groupbox /// this code is wrapped in another loop creating group boxes
1
1259
by: Vikas Kumar | last post by:
Hi Guys, Can I hav image with radiobuttonlist control instead of text....? Pls help me in this concern...
4
1609
by: Igor | last post by:
RadioButton have property Checked (true or false). If I make RadioButtons with code, without drawing by mouse than I have problems. I write like this: Dim rb(0 To 2) As RadioButton Dim n As Integer For n = 0 To 2 rb(n) = New RadioButton rb(n).Text = "Text: " + CStr(n)
1
4340
by: Trev | last post by:
Hi, I'm hoping that someone in this group can shed some light on an issue I'm having with a Formview. I have a Web User Control (.ascx) with a Formview. The Formview contains 2 Multiviews, one in the EditItemTemplate and one in the InsertItemTemplate. Each of those Multiviews contains several Views, and each view contains several controls such as textboxes, checkboxes etc. Those controls are bound to the Formview's datasource, which...
8
44038
by: =?Utf-8?B?UmljaA==?= | last post by:
If you enclose a group of radiobuttons (option buttons in MS Access) in an option group control (a frame control) in Access -- the frame control will return the index of the option button that is checked. In VB.Net if I enclose a group of radiobuttons in a groupbox control - I get the single checked radiobutton behavior, but the groupbox does not seem to return the index of the checked radiobutton. Is there a way to get the groupbox...
1
2559
by: Christiano Donke | last post by:
Hy there, pla.. i have 2 nested repeaters. In the child i have 3 radiobuttons. Already made my homework and figured out how to allow only one radio to be checked.... but now, i can't find out which radio is selected.
0
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10069
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.