Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books

»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects

»Competition
Community
Winners
Prizes
Write For Us
Members

»Other Resources
Links
Dotnet Resources


Forums»C# .NET »



inserting dropdownlist item into sqlserver

Hi,
I have populated values from a table to dropdownlist.
now i want to insert selected dropdown list item in to sql server database. i have written code for this, but everytime the first item in dropdown list is inserting eventhough i select to other.
could any body let me now solution for this problem.
thanks in advance.

this is my command object:
myCmd = new SqlCommand("INSERT INTO EmpInfo ( EmpID, EmpName, Location, Department) VALUES ( @empid, @empname, @location, @department)",connection);

myCmd.Parameters.Add("@department", SqlDbType.VarChar).Value = drpdnlDept.SelectedItem.Text;
posted by:anonymous on 7/9/2007 12:00:00 AM
© 2008 dotnetwatch.com -- Privacy policy

Website Design & Internet Marketing by Shivam