473,395 Members | 2,468 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,395 software developers and data experts.

Binding a Radiobuttonlist to a Database

20
I am binding a radiobuttonlist to a data field in a database. If the field has a null value my application produces an error maybe because the null value wont be an item in the radio button list. What I want is the radiobuttonlist not to check any value if it is not in the list Please Help
Nov 5 '08 #1
3 1446
sijugeo
42
I am binding a radiobuttonlist to a data field in a database. If the field has a null value my application produces an error maybe because the null value wont be an item in the radio button list. What I want is the radiobuttonlist not to check any value if it is not in the list Please Help


Validate the Input coming from database before assigning to the radiobuttonlist

if(Value!="")
{
//Include the binding code here
}

Siju
Nov 5 '08 #2
Garudzo
20
Thanks for the advice but this assumes that I am doing the binding in code. In this case I just draged the control to a formview and set the databound property. Cant I do it without using code?
Nov 5 '08 #3
Frinavale
9,735 Expert Mod 8TB
Thanks for the advice but this assumes that I am doing the binding in code. In this case I just draged the control to a formview and set the databound property. Cant I do it without using code?
If you want to put custom validation on your data you will need to customize it using code.

You can drag the RadioButtonList control onto your form...but you will have to customize the data source that you are binding it to.
Nov 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Hazzard | last post by:
I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar) I am creating an edit functionality on the asp.net form so that when I reuse my...
1
by: Christian H | last post by:
Hi! I'm wondering how I can add extra html to a radiobuttonList, so that I can control how: -the whole radioButtonList is rendered. -each of the radiobutton elements are rendered. What I am...
0
by: ani | last post by:
Hi, I have a datalist control and within the Itemplate I have a radiobuttonlist control . I am binding data to the datalist control in Page_load . Also I have sqldatareader object that needs...
1
by: Michael | last post by:
Hi, This should be fairly simple, but it is driving me nuts. First off I have a table in SQL Server, with a column of type "bit". This is meant to store a answer to a Yes/No question. I'm...
6
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and...
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...
2
by: Tim | last post by:
I have a radio button list control in the edit item template of a formview, as below. I want to bind this to a bit field from my sql database, however I can't seem to figure it out. Could some...
4
by: sck10 | last post by:
Hello, I am trying to use a radiobutton inside of a FormView for editing data. My question is how do you bind the radio buttons to the data field? Thanks, sck10 <td style="width:30%;...
13
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.