Databinding issue with dropdown

Discussion in 'ASP .Net' started by Neel, Oct 22, 2003.

  1. Neel

    Neel Guest

    I would like to bind a custom sql statement such as

    sSqlStmt = "SELECT PgmSchID, SessionBegDate" & " - "
    & "SessionEndDate" & " - " & "SessionTime" & " - "
    & "SessionDay AS PgmSessions" _
    & " FROM ProgramScheduling WHERE PgmID
    = '" + ddlPgm1.SelectedItem.Value + "'"

    below is my code which i am not able to bind
    OleRdr = clsDBAccess.ExecuteReader(CommandType.Text,
    sSqlStmt)
    ddlPgmSess1.DataSource = OleRdr
    ddlPgmSess1.DataTextField = "PgmSessions"
    ddlPgmSess1.DataValueField = "PgmSchID"
    ddlPgmSess1.DataBind()
    ddlPgmSess1.Items.Insert(0, "Select
    Session")
    ddlPgmSess1.SelectedIndex = 0

    help me out
    Neel
     
    Neel, Oct 22, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kris Rockwell

    Problems wit Databinding to a DropDown box

    Kris Rockwell, Apr 4, 2004, in forum: ASP .Net
    Replies:
    8
    Views:
    446
    Kris Rockwell
    Apr 6, 2004
  2. John Blair
    Replies:
    3
    Views:
    494
    John Blair
    Dec 28, 2004
  3. darrel

    Databinding dropdown on postback?

    darrel, Jun 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    404
    darrel
    Jun 7, 2005
  4. jobs
    Replies:
    0
    Views:
    1,762
  5. Earl Teigrob
    Replies:
    1
    Views:
    444
    Shravan
    Mar 1, 2004
Loading...

Share This Page