473,770 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CheckBoxList Data Binding Problem

Hello, theres,
I'm newbie in asp.net. I have problem in CheckBoxList binding to
database. Considering my case in a member system,
if I have 2 tables one for interest, one for memberInterest
the SQL DDL like follows:
create table interest ( intId int, intName varchar(20))
go
Insert into interest values ( 1, 'Music')
Insert into interest values ( 2, 'Jogging')
Insert into interest values ( 3, 'Fishing')
Insert into interest values ( 4, 'Reading')
go
create table MemberInterest ( memName varchar(10),
meminterest int)
go
-- Peter like Music, Reading
insert into MemberInterest values ('Peter', 1)
insert into MemberInterest values ('Peter', 4)
-- Nick like Music,Jobbing, Fishing
insert into MemberInterest values ('Nick', 1)
insert into MemberInterest values ('Nick', 2)
insert into MemberInterest values ('Nick', 3)
go

Now I want to use a checkBoxList to show the records when the user
login, how to use dataset to bind the checkboxlist
and when updating checkboxlist also sync to database ??

Any idea or example ??
(Is it need to update to db via iterate each listitem like
asp ?? )

Regards,
Agi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
0 1498

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

Similar topics

0
5815
by: rob | last post by:
Here is my scenario: One of my aspx pages has a CheckBoxList (Item1, Item2) and a GridView. Then I have a database that has the columns Item1 and Item2 (among others) with the data type bit. What I am trying to do is to only show the data sets chosen by the user. So for example if the user checks Item1 in the CheckBoxList then only the datasets that have Item1 set to True should be listed in the GridView. Here is what I tried: ...
1
5384
by: Tom | last post by:
Hi, I have a webform which has DropDownList, RadioButtonList and CheckBoxList. All values are in webform, but not select from DB table as they do not need to be used as search requirements. For DropDownList and RadioButtonList, there is only one item is selected and store in DB table.
2
1138
by: Philip Townsend | last post by:
I am having some difficulty getting a checkboxlist control to determine which checkboxes are checked. Here is a code sample from the event that should read it: private void btnFilter_Click(object sender, System.EventArgs e) { ArrayList arr=new ArrayList(); for(int i=0;i<ckFilter.Items.Count;i++) { if(ckFilter.Items.Selected)
5
13394
by: Patrick.O.Ige | last post by:
I'm binding a CheckBoxlist below in the ItemDataBound(the CheckBoxList is in a Datalist) By doing "li.Selected = True" i can see all the checkBoxes are selected. But what i want is to be able to get a Boolean value TRUE or FALSE when a checkBox is selected. When the checkBoxList was out of the DataList i used "OnSelectedIndexChanged" and it was returning what i wanted but if its in a
2
5237
by: Patrick.O.Ige | last post by:
I have some boolean value(1 or 0 ) in a table and i want a databinded CheckBoxList to present the selected values on the page.. With CheckBox i know i can se the Checked property like so :- <asp:CheckBox id="chk" checked=<% Databind.Eval("This returns 1 or 0")%> runat="server"%> Any help how i can do it using CheckBoxList?
1
1108
by: Jeppe Jespersen | last post by:
Checkout a little 3-minuter video i made, illustrating my problem. http://www.netkoder.dk/cl/ Any ideas? Jeppe
0
1793
by: Nam | last post by:
I want to use the same sqlDataSource for two CheckBoxList controls in ASP.NET 2.0. For simplicity, I am using the case of only two CheckBoxList controls in the following example: My sqlDataSource is bound to a table in my database. The table has four columns, say, col1_ID, col1_value and col2_ID, col2_value. The DataValueField and DataTextField values for CheckBoxList1 are bound to col1_ID and col1_value respectively. And, for...
4
22850
by: haresh.amis | last post by:
hello to all, I m using .net 2.0 and i face a problem that is as under Well I have a checkboxlist which i bound in .cs page now I want to count that how many checkboxes ate checked ( In javascript ) and checked checkboxes text will be concat and that string will be pass on to report query I m trying on by this code but it's not work
1
7938
by: terminul | last post by:
Hi I have a datalist which loops through the categories and within the datalist I have a CheckBoxList which are bound on the DataList's OnItemDataBound. The only problem I have is retrieving the values that have been checked when the user submits the form. This code works as far as presentation goes but I can't seem to retrieve the checked values in the various checkboxlists that have been generated on the datalist's OnItemDataBound ...
0
9591
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
9425
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
10057
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...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
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
6676
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
5312
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...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.