473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

RadioButtonList and Selected

Jay
I have a radiobuttonlist like so

<asp:RadioButtonList id=radType RepeatDirection="Horizontal" cellpadding="10" cellspacing="0" runat="server"><asp:ListItem value="Something1"><font face="arial,helvetica" size="2">Something 1</font></asp:ListItem><asp:ListItem value="Something2"><font face="arial,helvetica" size="2">Something 2</font></asp:ListItem><asp:ListItem value="Something3"><font face="arial,helvetica" size="2">Something 3</font></asp:ListItem><asp:ListItem value="Something4"><font face="arial,helvetica" size="2">Something 4</font></asp:ListItem></asp:RadioButtonList

The selected value of the radType is saved to a table

When opening the page, I am using a datareader to read a row in a table, I then need to make one of the items in the list selected based on what is in the table row. Eg

Dim DBConnection As SQLConnectio
Dim DBCommand As SQLComman
Dim DBReader As SQLDataReade
Dim SQLString As Strin
DBConnection = New SQLConnection("connection string here"
DBConnection.Open(
SQLString = "SELECT * from table1 where uid='" & request("uid") & "'
DBCommand = New SQLCommand(SQLString, DBConnection
DBReader = DBCommand.ExecuteReader(
DBReader.rea
radJobType.selectedvalue=DBReader("type")
DBReader.Close(
DBConnection.Close(

This doesn't seem to work. How can I make the item in the radiobuttonlist selected based on the value in the row

Thanks

Nov 18 '05 #1
0 999

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

Similar topics

3
by: William LaMartin | last post by:
If I create a RadioButtonList with, say, two items, then after the page loads and I select one of the items and then click on a button whose click event contains some code to display the...
5
by: DotNetGruven | last post by:
Anyone have any pointers on how to set the Value and Selected attributes in a ListItem in a RadioButtonList that is in a DataGrid? Here's what I have ------DataGrid------ -- BoundColumn 0 --...
4
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
3
by: Mark Broadbent | last post by:
try as I might (and using different properties) this control always seems to be returning the first element of the control as the "selected" item even though I am selecting the second element. All...
0
by: Luis Esteban Valencia | last post by:
http://www.codeproject.com/aspnet/DataGridCCEvents.asp#xx1009236xx Read this first and see if you can help me have tried but the Intelisense of the radiobuttonlist doestn have the event...
0
by: Hugo Flores | last post by:
Hi, Here's the situation: I create a table on run time(Page_Init) I add a textbox to the first row I add a RadioButtonList in that same row The problem is that when I try to get the values...
4
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load (page_load) i create dynamically an html table which contains a checkbox and a radiobuttonlist in each tablerow . The...
2
by: Michael Bohman | last post by:
Hi, i have a small problem with assigning a database value to a RadioButtonList control. On my form i have 3 user admin=1, premium=2 and basic=3, theese values is stored in an access database in a...
6
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.