473,804 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOW TO Refresh a Drop Down List Box ???

ASP.NET 2.0 / SQL Server 2000 db / Visual Basic Code behind

On my .aspx page I have added an SQL Datasource that contains the SQL query
to retrieve the list for my Drop Down List Box.

Using this SQLDataSource I can retrieve my drop down list data.

SELECT DISTINCT responsibleMini ster
FROM responsibleMini ster
WHERE languageID = @languageID
ORDER BY responsibleMini ster ASC
I have a button that I have added that calls a stored Proc to INSERT DATA
into that same table

BEGIN
-- Find the next PK value for responsibleMini sterID
DECLARE @responsibleMin isterID smallint
SELECT @responsibleMin isterID=MAX(res ponsibleMiniste rID)+1
FROM dbo.[responsibleMini ster]
WHERE languageID=@lan guageID

INSERT INTO dbo.[responsibleMini ster](
[responsibleMini sterID],
[languageID],
[responsibleMini ster])
VALUES (
@responsibleMin isterID,
@languageID,
@responsibleMin ister)
END

The Insert Stored Procedure works well, however, I now need to UPDATE my
Drop Down List box with the data that lies within the responsible Minister
table.

I tried to enable Post Back but that did not refresh the drop down list.

Can someone please help me resolve this issue of "How I may REFRESH the list
found within the drop down list box with the new values found within the
database table"???

Any ideas would be greatly appreciated,

Thanks,

~Brad
------------------------------
Brad Isaacs
Mar 28 '07 #1
3 15009
bpd
On Mar 28, 12:44 pm, "Brad Isaacs" <bisa...@rogers .comwrote:
ASP.NET 2.0 / SQL Server 2000 db / Visual Basic Code behind

On my .aspx page I have added an SQL Datasource that contains the SQL query
to retrieve the list for my Drop Down List Box.

Using this SQLDataSource I can retrieve my drop down list data.

SELECT DISTINCT responsibleMini ster
FROM responsibleMini ster
WHERE languageID = @languageID
ORDER BY responsibleMini ster ASC

I have a button that I have added that calls a stored Proc to INSERT DATA
into that same table

BEGIN
-- Find the next PK value for responsibleMini sterID
DECLARE @responsibleMin isterID smallint
SELECT @responsibleMin isterID=MAX(res ponsibleMiniste rID)+1
FROM dbo.[responsibleMini ster]
WHERE languageID=@lan guageID

INSERT INTO dbo.[responsibleMini ster](
[responsibleMini sterID],
[languageID],
[responsibleMini ster])
VALUES (
@responsibleMin isterID,
@languageID,
@responsibleMin ister)
END

The Insert Stored Procedure works well, however, I now need to UPDATE my
Drop Down List box with the data that lies within the responsible Minister
table.

I tried to enable Post Back but that did not refresh the drop down list.

Can someone please help me resolve this issue of "How I may REFRESH the list
found within the drop down list box with the new values found within the
database table"???

Any ideas would be greatly appreciated,

Thanks,

~Brad
------------------------------
Brad Isaacs
I'm assuming you're binding the datasource to the dropdownlist control
somehow.
After the insert/update, you'll need to re-bind.

Mar 28 '07 #2
Call the DataBind() function of the drop down list.

Mar 29 '07 #3
bpd & Latish,

Thank you very much for your input

~Brad
:)))
"Latish Sehgal" <la***********@ gmail.comwrote in message
news:11******** *************@n 76g2000hsh.goog legroups.com...
Call the DataBind() function of the drop down list.

Mar 29 '07 #4

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

Similar topics

1
1922
by: Tom Ewall | last post by:
I have an iframe which has a drop-down list, which I'm trying to use to refresh a drop-down list in the main page. I'm using this call to refresh the page: window.parent.document.all.asset_id_list.innerHTML = document.all.assetid.innerHTML; When the list is displayed in the main page, it doesn't display as a drop-down list, but instead displays the contents of the list like this:
3
14225
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want to insert the values and text to each drop down list. So i want to create a script that populates a certain Drop Down List with certain values when page loads such as:
2
12626
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
3
6899
by: Yi Chen | last post by:
We have a drop down list on a PHP page, with several product names, and when people click one item, we will refresh the same page with the product name as parameter, and in turn we want to include a HTML file into the content area of the same page. I know it is recommended to put everything into database, but we want the web site to be very "portable", so the drop-downlist and the content should both in text files. Let's say the...
5
18734
by: ashok893 | last post by:
I'm using two drop down list ina form. I have generated the first drop down list from MySQL database. When i select an option from first drop down list, i have to generate second drop down list options by the selected value of first drop down list from MySQL database. For example, the first drop down list contains Animals, Birds... If i select the Animal option, the second drop down list should show like Lion, Tiger.... Both lists should...
0
2168
by: weiwei | last post by:
Hi here is my scenario, I create a drop down list in itemtemplate.(that drop down is created from db), after user click edit command, my ideal plan is have another drop down list in edititemtemplate with preselected value from the previous drop down list, so far I can only achieved with the regular drop down list in edititemtemplate with no preselected value from previous one. anyone can help me. thanks in advance. below is my current...
3
7362
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the document selected (my application uses the BusinessObjects Java Web Services SDK) The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do -select a folder from the...
2
3341
by: crazychrisy54 | last post by:
Hi there I have a option, select drop down list which a user can open. My page however refreshes very frequently and when this occurs the selected drop down list will pop back up. The user then has to open the drop down list again. I just wondered if there was a way using javascript to firstly detect if the user has selected the drop down list and if so, on refresh to set that drop down list to stay dropped down?
0
9706
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
9579
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
10571
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
10326
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...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9143
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
7615
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
6851
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
4295
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

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.