Help! SqlDataSource to TextBox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • deegee@360computing.net

    #1

    Help! SqlDataSource to TextBox

    Hi,

    I'm new to C# and Visual Studio 2005 and very confused trying to do a
    very simple thing (I think).
    All I want to do is: when a page loads it runs a query on a table in a
    database and displays the fields in various text boxes on the page.
    I've added the SqlDataSource to the page ok; added the textbox ok; but
    how do I bind the results of the query to the textbox?!?! Should be
    so simple but I keep finding VS2003 examples

    protected void Page_Load(objec t sender, EventArgs e) {
    SqlDataSource1. SelectCommand = "select name from person where
    person_id = 1";
    //TextBox1.Text = result of above command!!!!!!

    }

    I'd be very grateful for any advice/suggestions/dummies guide on how to
    do this. While I'm here, can anyone recommend a good c#/asp.net book?

    Thank you!!

    deegee

Working...