Results 1 to 3 of 3

Thread: New to C# and .NET, Need some help with Database stuff *resolved*

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    New to C# and .NET, Need some help with Database stuff *resolved*

    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.
    Last edited by Graff; Apr 20th, 2003 at 03:04 PM.
    If wishes were fishes we'd all cast nets.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width