data bound dropdownlist from MS Access
-
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:
-
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: