Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2012, 08:14 AM
Registered User
 
Join Date: Aug 2003
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);





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





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