473,399 Members | 3,888 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,399 software developers and data experts.

Record Not Updated in DropDownBox

Dear All,

I have a web form which has a link and a drop down box. when I press a
link
a pop up window opens. This window has a lot of TEXTBOXES and a Save
button. When I fill the TextBoxes and press save the POP UP window closes.
Actually this POP UP window is a record of an employee. so basically I am
filling the personal information of the employee. What I want is that
when I
press save Button the POP UP window must close. And It should display the
ID number of recently entered Employee in the dropdown box. Below is my
Code
behind the save button in the POP UP window:
Dim strJavaScript As String

strJavaScript = "<script
language='javascript'>window.opener.execScript(""_ _doPostBack('LinkButton1','')"",""JavaScript"");wi ndow.close();</script>"

Page.RegisterStartupScript("", strJavaScript)

I have an invisible LINKBUTTON1 on the web form which has the dropdownbox.
Now in the load event of web form is the following code:

If Not IsPostBack
Dim conHcpMain As SqlConnection
Dim dtrHcpMain As SqlDataReader
Dim cmdIDs As SqlCommand
Dim dtrIDs As SqlDataReader
cmdIDs = New SqlCommand("Select * from HCP_IDs", conHcpMain)
dtrIDs = cmdIDs.ExecuteReader()
dropID.DataSource = dtrIDs
dropID.DataTextField = "Hcp_Id"
dropID.DataValueField = "Hcp_Id"
dropID.DataBind()
dtrIDs.Close()
End if

This Code actually displays IDs of all the Employees in the Database.
And in the
click event of the LINKBUTTON1 I have the same code as above but without a
post back:

Dim conHcpMain As SqlConnection
Dim dtrHcpMain As SqlDataReader
Dim cmdIDs As SqlCommand
Dim dtrIDs As SqlDataReader
cmdIDs = New SqlCommand("Select * from HCP_IDs", conHcpMain)
dtrIDs = cmdIDs.ExecuteReader()
dropID.DataSource = dtrIDs
dropID.DataTextField = "Hcp_Id"
dropID.DataValueField = "Hcp_Id"
dropID.DataBind()
dtrIDs.Close()
When I add a record through a POP UP WINDOW it adds it perfectly into the
database. but it doesnt show the recently added record in the dropdownbox

Any help would be greatly appreciated.

cheers,
Sunil Sabir

Nov 19 '05 #1
0 948

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

Similar topics

6
by: thomas j | last post by:
Hi, I have a MySqlBase with a tabel named CARS and with 3 fields; CarsType, CarsModel, CarsInfo. Now I want to generate 2 dropdownboxes in PHP read from CARS. First I will "load" CarsType into...
4
by: James P. | last post by:
Hello there, I have a bound-form using Navigator so that the user can move back and forth to update record in the form. Every time a record was modified and the user clicks the Navigator to...
3
by: sean | last post by:
I have a table with fixed row of records SORTED by DATE using ADO pagination method. The user can click a link in one table cell and go to another page to modify the record. Once the updated record...
11
by: Dan2kx | last post by:
Good evening Peeps got another question.... OK, i have a continous form with tick boxes, the idea is that (currently a single record) is selected and then that record number is used in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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
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...
0
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...

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.