For Programmers: Free Programming Magazines  


Home > Archive > C# > January 2006 > HELP! SqlDataSource to TextBox









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HELP! SqlDataSource to TextBox
deegee

2006-01-31, 7:02 pm

Hi,

I'm new to C# and Visual Studio 2005 and very 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(object 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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com