Selected value of a List box not populating in stored procedure

Posted on 2011-10-03
Last Modified: 2013-12-16
hello experts I have a listbox named LBFactSupNew and it is dynamically populated by this stored procedure listed below. now when I try to save the information to the data base while debugging line by line the selected value of the list box is comming up "" can some one tell me what the hell I am doing wrong???

   private void PopulateNewFactSuper()
            SqlConnection con = new SqlConnection(Settings.GetConfigValue("PARK_IRB_V1_11_19_2010", "IRB2010ConnectionString"));
            SqlCommand cmd = new SqlCommand("P_sp_PopulateNewFactSup", con);
            SqlDataReader r = cmd.ExecuteReader();
            DataTable dt = new DataTable();
            while (r.Read())
                ListItem i = new ListItem(r["truename"].ToString().Trim(), r["ParkID"].ToString().Trim());
Question by:HawaiiDragon
    LVL 6

    Expert Comment

    What method are you using to get the selected value?  In VB.NET it would be:

    LVL 20

    Accepted Solution

    Where have u called PopulateNewFactSuper.

    Add this.


    Author Closing Comment

    thank you!!!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now