473,385 Members | 1,326 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,385 software developers and data experts.

how to retreive checkbox value from the database in aspnet using c#

35
hello,

Actually I want to retreive the checkbox value from the database.

I have written like this:-

Chkbillingcode =ds.Tables[0].Rows[i]["billingcode"].ToString() ;
But it gives error.Could u help me to solve this problem.
Jan 8 '07 #1
5 9000
hello,

Actually I want to retreive the checkbox value from the database.

I have written like this:-

Chkbillingcode =ds.Tables[0].Rows[i]["billingcode"].ToString() ;
But it gives error.Could u help me to solve this problem.
hi..
r u trying to check d checkbox ctrl based on d database result?
is "Chkbillingcode" a checkbox ctrl?
then u can have it like Chkbillingcode.Checked=true or false...
hope this helps..
thanx,
sand...
Jan 8 '07 #2
muskan
35
thanks for reply

I have tried like that

Chkwithdrawn.Checked =ds.Tables[0].Rows[i][15].ToString();
but it still not working .It gives the error" cannot implicitly convert object to bool"

tell how to remove this error.

hi..
r u trying to check d checkbox ctrl based on d database result?
is "Chkbillingcode" a checkbox ctrl?
then u can have it like Chkbillingcode.Checked=true or false...
hope this helps..
thanx,
sand...
Jan 8 '07 #3
Muskan,

Try Out:
CheckBox1.Checked=Convert.ToBoolean(ds.Tables[0].Rows[0]["IsVisible"].ToString());

thanks for reply

I have tried like that

Chkwithdrawn.Checked =ds.Tables[0].Rows[i][15].ToString();
but it still not working .It gives the error" cannot implicitly convert object to bool"

tell how to remove this error.
Jan 8 '07 #4
thanks for reply

I have tried like that

Chkwithdrawn.Checked =ds.Tables[0].Rows[i][15].ToString();
but it still not working .It gives the error" cannot implicitly convert object to bool"

tell how to remove this error.
Hi...
u r gettin error b'coz Checked property of d checkbox has to b assigned a boolean value...true or false only...
so u will have 2 convert d data retrieved frm database into bool type...
OR
if it can't b converted, use a boolean flag variable to hold true or false based on
the data retrieved frm d database...for that, first retrieve d data value frm database and check it's value inorder to assign value to d boolean flag....
hope this helps,
thanx and rgrds
sand...
Jan 8 '07 #5
muskan
35
thanks for reply
now it is working

Muskan,

Try Out:
CheckBox1.Checked=Convert.ToBoolean(ds.Tables[0].Rows[0]["IsVisible"].ToString());
Jan 8 '07 #6

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

Similar topics

4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
2
by: Tomas Vera | last post by:
Hello All, I'm having problems creating a page with dynamic checkboxes in a WebApp. In my app, I need to query a database, then (based on results) add checkboxes to my form and set their...
2
by: Edmilson | last post by:
Hello All I have a Datalist where each "Item" contains a checkbox (among other things). I want the user to be able to click on one or more checkboxes, click the Send button, and have something...
2
by: /.. | last post by:
Hi all, I'm working on a report display page that currently uses 5 checkboxlists with a total of 86 items to display values from 5 different tables in an Access database. The page works fine...
1
by: iforsyth | last post by:
Have a paging datagrid with a checkbox control in column(0). ViewState is enabled. I check the checkbox in first row of the grid on a page and then the program hits this event: Private Sub...
4
by: | last post by:
I have a checkbox on a web page. When it is checked, I want a Table to appear (or disappear when the checkbox is cleared)... I was hoping to use client side code for this, so I created a short...
6
by: Daz | last post by:
Hi everyone. Firstly, I apologise if this i not what you would call a PHP problem. I get quite confused as to what lives in which realm, so if this shouldn't be posted here, please suggest where...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.