I'm trying to pull some records from my MS SQL 2000 Database and I've been having problems determining how I can get these values into an drop down list.
Here's the code I have thus far.
Code:private void Page_Load(object sender, System.EventArgs e) { SqlConnection conn; SqlDataAdapter objDataReader; // Put user code to initialize the page here // cboLinks.Items.Add(new ListItem("Fark","http://www.fark.com")); conn = new SqlConnection("server=localhost;uid=admin;pwd=adsf;Database=Test"); String SQLSelect = "SELECT * FROM Links"; objDataReader = new SqlDataAdapter(SQLSelect,conn); //Don't know what goes here to add to combo box conn.Close(); }
Edit: Oh yea the table is called Links, it contains 3 columns; ID, Text and Address.




Reply With Quote