venterm
asked on
populate dropdownlist with datareader
Hi there,
I am having a problem with populating a dropdownlist. The code is as follows :
myConnection = New SqlConnection ("server=slserver;uid=;pwd =;database =meta_dev" )
SQL$ = ""
SQL$ = SQL$ & " select glpd_key "
SQL$ = SQL$ & " from gl_period "
myConnection.Open()
myCommand = New SqlCommand(SQL$, myConnection)
myDataReader = myCommand.ExecuteReader()
Me.ddl_glperiod.DataSource = myDataReader
Me.ddl_glperiod.DataBind()
'close connection to item_map_gl
myConnection.Close()
ddl_glperiod.SelectedIndex = 15
When the page load - it populates the dropdownlist with System.Data.Com.... If i debug the code, there is no errors.
Can someone help please ....
Thanks
I am having a problem with populating a dropdownlist. The code is as follows :
myConnection = New SqlConnection ("server=slserver;uid=;pwd
SQL$ = ""
SQL$ = SQL$ & " select glpd_key "
SQL$ = SQL$ & " from gl_period "
myConnection.Open()
myCommand = New SqlCommand(SQL$, myConnection)
myDataReader = myCommand.ExecuteReader()
Me.ddl_glperiod.DataSource
Me.ddl_glperiod.DataBind()
'close connection to item_map_gl
myConnection.Close()
ddl_glperiod.SelectedIndex
When the page load - it populates the dropdownlist with System.Data.Com.... If i debug the code, there is no errors.
Can someone help please ....
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.