471,317 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

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(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

Jan 31 '06 #1
0 946

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by wukexin | last post: by
3 posts views Thread by Colin J. Williams | last post: by
7 posts views Thread by Corepaul | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.