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

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

Hommer
Aged Yak Warrior

786 Posts

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

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.

Thanks!

afrika
Flowing Fount of Yak Knowledge

Nigeria
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

http://msdn.microsoft.com/en-us/library/aa581783.aspx
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.08 seconds. Powered By: Snitz Forums 2000