Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Development Tools
 textbox data binding
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

808 Posts

Posted - 10/01/2012 :  11:37:44  Show Profile  Reply with Quote

I have a simple aspx page. The sqlDataSource1 has a select running against sql 08 db, and the DataList was able to bind to the return values.

Now when I tried to feed that data into several textboxes, I got stucked.

Neither syntax get me the data. :(

<%# DataBinder.Eval(SqlDataSource1 , "ID") %>
no error but SqlDataSource1 itself showed

<asp:TextBox ID=txt Text="<%# status %>" runat=server />
error: CS0103: The name 'status' does not exist in the current context

I have Page.DataBind(); in the page_load on the code behind file.

I haven't done front end coding for a while. This is in vs 2010.


Flowing Fount of Yak Knowledge

2706 Posts

Posted - 10/14/2012 :  11:48:18  Show Profile  Reply with Quote
I would not use sql datasource, I would advice you to use object data source and bind the values to a textbox on the code behind

this might help
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000