Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 8th, 2004, 04:57 AM
Authorized User
 
Join Date: Jun 2003
Location: Kuala Lumpur, Wilayah Persekutuan, Malaysia.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maha
Default Dropdown list

Hi All,

Good day. I have a data bound dropdown list and text box in my aspx page. I wish to make the text of the dropdown list to appear in the text box immediately once I select a text from the dropdown list.

How can I do this? Please assist.

Thanks,
Maha
Reply With Quote
  #2 (permalink)  
Old September 8th, 2004, 07:09 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Set the dropdownlist autopostback property to true and
in the dropdownlist SelectedIndexChanged event set the TextBox's Text value as
DropDownList's SelectedValue.

Reply With Quote
  #3 (permalink)  
Old September 8th, 2004, 11:21 PM
Authorized User
 
Join Date: Jun 2003
Location: Kuala Lumpur, Wilayah Persekutuan, Malaysia.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maha
Default

Hi Santi,

Good day.

Thanks for your assistance. I followed your advised and it worked. I used the combobox's event property to fire the result into the textbox.

Thanks,
Maha:D
Reply With Quote
  #4 (permalink)  
Old September 8th, 2004, 11:39 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Thats good

Reply With Quote
  #5 (permalink)  
Old September 9th, 2004, 09:31 PM
Authorized User
 
Join Date: Jun 2003
Location: Kuala Lumpur, Wilayah Persekutuan, Malaysia.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maha
Default

Shanti,

Good day. Would you please guide me how to insert record into a table? I have an MS Access table (let me call it tblGroup). I have a form with one text box (txtTextBox) and a submit button in .aspx page.

Please guide me how to establish database connection to the table and insert the contents in text box into the table when I click the submit button. Preferably, you give me some samples.

Your assistance is much appreciated.

Thanks,
Maha
Reply With Quote
  #6 (permalink)  
Old September 15th, 2004, 09:05 AM
Authorized User
 
Join Date: Jul 2004
Location: Bangkok, , Thailand.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

suppose your database is c:/db/group.mdb and this folder is shared so you can update the database.
your Page_Load event shoud be like this
private sub Page_Load(sender as object,e as System.EventArgs)
dim cnstr as string
dim cnn as OledbConnection
cnstr="Provider=Microsoft.Jet.OleDB.4.0;Data Source=c:/db/group.mdb"
cnn=new OleDBConnection(cnstr)
cnn.Open()
dim ssql as string="Insert into tblGroup(GroupName) Values(" & txtTextbox & ")"
dim cmm as OleDbCommand=new OleDBCommand(ssql,cnn)
cmm.ExecuteNonQuery()
cnn.Close()
end sub

let's try. on the top of the page you should the directive <%@ Import NameSpace="System.Data"%> and <%@ Import NameSpace="System.Data.Data"%>

Reply With Quote
  #7 (permalink)  
Old September 15th, 2004, 09:25 AM
Authorized User
 
Join Date: Jul 2004
Location: Bangkok, , Thailand.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry MAHA
      you should put it in the onCLick event not the onLOad event

Reply With Quote
  #8 (permalink)  
Old April 28th, 2007, 12:32 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Quote:
quote:Originally posted by Santhi
 Set the dropdownlist autopostback property to true and
in the dropdownlist SelectedIndexChanged event set the TextBox's Text value as
DropDownList's SelectedValue.

thak u santi

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gridview with a dropdown list paullam71 ASP.NET 2.0 Basics 0 July 22nd, 2007 09:43 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
HELP WITH DROPDOWN LIST enavas Excel VBA 1 April 6th, 2004 02:08 PM



All times are GMT -4. The time now is 02:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.