SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

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

Aged Yak Warrior

804 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  
 New 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.06 seconds. Powered By: Snitz Forums 2000