Filling a DropDownList from a Sproc

Results 1 to 2 of 2

Thread: Filling a DropDownList from a Sproc

  1. #1
    Join Date
    Dec 1969

    Default Filling a DropDownList from a Sproc

    Hello All<BR>I am trying my coding skills to learn ASP.NET. I am using C# as my language. I am trying to connect to, and display data in a dropdownlist. I have my database connection string in the Web.config file. I have SQL Running and a Sproc created to list all the stateId&#039;s and StateNames from a table. I want to show the text in the DDL as the statename, and the ID in the DDL as the StateID. How do I do this using Visual Studio? I cannot find anything that can tell me exactly step-by-step on how to do this. My Connection is named DBConn my SPROC is named Sel_StateNames.<BR><BR>All these books out here describe how to connect, and then how to set up a data adapter etc.... But none on how to fill a DDL using SQL and a Sproc. Please tell me exactly what is supposed to be in each of the property entries of my DDL in VS. Or tell me where I can read this on a site. I have yet to find anything on using the connection string in the web.config using a Sproc.<BR><BR>Thanks<BR>Andrew

  2. #2
    Join Date
    Dec 1969

    Default RE: Filling a DropDownList from a Sproc

    It&#039;s a fairly big topic, but I&#039;d suggest starting with the quickstart tutorials:<BR><BR>Specifically, I&#039;d look under "Web Forms" at "Data Binding Server Controls". I also may whip; up a sample in a bit if I have some free time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts