473,761 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem while retrieving multiple item in checkboxlist

6 New Member
I cant retrieve selected item from checkboxlist in asp.net project.
when i submit multiple item from checkboxlist it works fine. but when i am trying to edit this items then checkboxlist does not select the previous values that i have selected.It only selects one item. my code which i am using for edit is following:
Dim _drArticle As SqlDataReader
_drArticle = SqlHelper.Execu teReader(Config urationSettings .AppS ettings("Connec tionString"), _
CommandType.Tex t, _
"SELECT *FROM MST_ACCESS WHERE MA_MUT_ID=" & CInt(Request.Qu eryString("ArtI D")))



If _drArticle.HasR ows Then

_drArticle.Read ()
On Error Resume Next
'checkboxlist1. SelectedValue = _drArticle("MA_ MUR_ID")

Dim i As Integer
For i = 0 To checkboxlist1.I tems.Count - 1
If checkboxlist1.I tems(i).Selecte d = True Then
checkboxlist1.I tems(i).Value = _drArticle("MA_ MUR_ID")
checkboxlist1.S electedValue = checkboxlist1.I tems(i).Value

End If
Next
end if
Jan 17 '07 #1
0 1190

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

Similar topics

0
2050
by: bill yeager | last post by:
Duray, it helps in regards to knowing how to get the items that were selected in the lisbox, but I'm going in reverse --- after I get the items from the db that were selected, I'd like to be able to highlight them in the listbox within the datagrid control......... Thanks, Bill... >-----Original Message-----
4
2093
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event. Each question is displayed and answered, then result written to a SQL table. Then the next question is read from a table and displayed using the load_page event again. The questions display and function perfectly. The user anwers the question...
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
1
1487
by: Patrick.O.Ige | last post by:
I have CheckboxList Databinded below and that works fine and i can get the selected values after PostBack. But what i have noticed is that when you select a checkbox i.e lets say 3 of them and later unselect them the last one u unselect remains printed out on the screen. How can i reset Checkboxlists back to NULL. I need to do this becos i'm passing the values to a QueryString and if the unselect and remains in the queryString its a...
1
1206
by: Lynn | last post by:
Hello, I have a page that allows the person to select multiple items from a checkboxlist. The checkboxlist is being populated from a table in the database. The user's selections are sent to the database as a comma separated list (ex. 17, 22, 35). I also have a page that allows the user to edit existing records. I am unsure of how to build the checkboxlist on the edit page and have the various checkboxes checked based on what is in the...
1
2199
by: Mike | last post by:
I have a Datalist control on my page that I have binded to a table of available categories. In the Item Template I have a CheckboxList control bound to the products available in each Category. I need to pull out of the page which products the user has selected. I have bound the products to the CheckboxList control in the ItemDataBound event for the Datalist. How can I extract what checkboxes have been selected inside the Datalist?
1
1107
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
862
by: riteshraha | last post by:
i cant retrieve selected item from checkboxlist in asp.net project. when i submit multiple item from checkboxlist it works fine. but when i am trying to edit this items then checkboxlist does not select the previous values that i have selected. my code which i am using for edit is following: Dim _drArticle As SqlDataReader _drArticle = SqlHelper.ExecuteReader(ConfigurationSettings.AppSettings("ConnectionString"), _ ...
1
3086
by: sheenaa | last post by:
Hello friends, I m using ASP.NET with C# 2005 and SQL SERVER 2005 for the ASP.Net Website. I m using sqldatasource to connect and retrieve the data from database and then it displays the data in the gridview on the button click event.I have created the stored procedure for insert and select query. Now in my application i have used checkboxlist where there can be multiple selection for the hobbies. I want to know how can i store the...
0
9377
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
10136
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
9811
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...
0
8814
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
7358
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
6640
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();...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
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.