Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 May 18th, 2012, 08:14 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Lagos, Lagos, Nigeria.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dababy Send a message via Yahoo to dababy
Default My Dropdown List not inserting selected value into database.

Sqlds.InsertCommandType = SqlDataSourceCommandType.Text;
Sqlds.InsertCommand = "insert into Population(States,LGA,Males,Females,Bothsexes,Land size,Terrain,Remarks) values (@countryList,@statelist,@male,@fmale,@bsexes,@lan dsize,@terrain,@remarks)";
Sqlds.InsertParameters.Add("countryList",countryLi st.SelectedValue);
Sqlds.InsertParameters.Add("stateList", stateList.SelectedValue);
Sqlds.InsertParameters.Add("male", male.Text);
Sqlds.InsertParameters.Add("fmale", fmale.Text);
Sqlds.InsertParameters.Add("bsexes", bsexes.Text);
Sqlds.InsertParameters.Add("landsize", landsize.Text);
Sqlds.InsertParameters.Add("terrain", terrain.Text);
Sqlds.InsertParameters.Add("remarks", remarks.Text);
Sqlds.Insert();




I am having problem with my dropdownlist, Its not inserting selected values into database only the first value on the list that is inserted into the db.

Here is the varable for it.

Sqlds.InsertParameters.Add("stateList", stateList.SelectedValue);
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
Inserting CheckBoxList selected items to database julianfraser BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 5 November 4th, 2009 04:43 PM
adding Dropdown list Items from SQLSERVER 2005 database biswa Pro VB Databases 1 October 23rd, 2009 10:46 AM
How to retain selected values from dropdown list?? skhan ASP.NET 3.5 Basics 5 September 1st, 2009 09:13 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
Title: dropdown list as selected according to the san_only ASP.NET 1.x and 2.0 Application Design 1 June 4th, 2003 01:55 AM



All times are GMT -4. The time now is 01:09 AM.


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