Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. data bound dropdownlist from MS Access

data bound dropdownlist from MS Access

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdatabasequestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pickron
    wrote on last edited by
    #1

    Hello ASP.net gurus! I tried to display a name of the person from a dropdownlist, once clicked on that name, also display the information about the person. The dropdownlist didn't display at all... no error...just blank. What did I do wrong? :confused: My code is below: Dim oOleDbConnection As OleDb.OleDbConnection Dim strPassword As String = "" Dim strDataBasePath As String = "c:\Membership.mdb" Dim dtrFindName As OleDbDataReader Dim myCmdFindName As OleDbCommand Dim sConnString As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & strDataBasePath & ";" & _ "Jet OLEDB:Database Password=" & strPassword & ";" oOleDbConnection = New OleDb.OleDbConnection(sConnString) oOleDbConnection.Open() myCmdFindName = New OleDbCommand("Select Name from MembershipList order by Name ASC", oOleDbConnection) dtrFindName = myCmdFindName.ExecuteReader ddlName.DataSource = dtrFindName ddlName.DataTextField = "Name" ddlName.DataBind() oOleDbConnection.Close() Any help is much appreciated! :rolleyes:

    P 1 Reply Last reply
    0
    • P pickron

      Hello ASP.net gurus! I tried to display a name of the person from a dropdownlist, once clicked on that name, also display the information about the person. The dropdownlist didn't display at all... no error...just blank. What did I do wrong? :confused: My code is below: Dim oOleDbConnection As OleDb.OleDbConnection Dim strPassword As String = "" Dim strDataBasePath As String = "c:\Membership.mdb" Dim dtrFindName As OleDbDataReader Dim myCmdFindName As OleDbCommand Dim sConnString As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & strDataBasePath & ";" & _ "Jet OLEDB:Database Password=" & strPassword & ";" oOleDbConnection = New OleDb.OleDbConnection(sConnString) oOleDbConnection.Open() myCmdFindName = New OleDbCommand("Select Name from MembershipList order by Name ASC", oOleDbConnection) dtrFindName = myCmdFindName.ExecuteReader ddlName.DataSource = dtrFindName ddlName.DataTextField = "Name" ddlName.DataBind() oOleDbConnection.Close() Any help is much appreciated! :rolleyes:

      P Offline
      P Offline
      pickron
      wrote on last edited by
      #2

      Never mind, gurus... this works! I cleaned up in the html code in the asp:dropdownlist tag.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups