Solved

populate dropdownlist with datareader

Posted on 2006-06-29
1
407 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:venterm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 43

Accepted Solution

by:
TimCottee earned 250 total points
ID: 17010130
Hi venterm,

This is a duplicate of your question in http://www.experts-exchange.com/Programming/Q_21903506.html#0 "populate dropdownlist with datareader" I believe it is already answered there.


Tim Cottee
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question