Click here to Skip to main content
15,908,909 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Question.NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 5:09
munklefish26-Sep-06 5:09 
AnswerRe: .NET2 Dispay data from SQL2005 Pin
Dayekh26-Sep-06 5:19
Dayekh26-Sep-06 5:19 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 5:23
munklefish26-Sep-06 5:23 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
Dayekh26-Sep-06 5:38
Dayekh26-Sep-06 5:38 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 5:42
munklefish26-Sep-06 5:42 
AnswerRe: .NET2 Dispay data from SQL2005 Pin
Keith Barrow26-Sep-06 6:25
professionalKeith Barrow26-Sep-06 6:25 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish26-Sep-06 6:34
munklefish26-Sep-06 6:34 
AnswerRe: .NET2 Dispay data from SQL2005 Pin
minhpc_bk26-Sep-06 16:10
minhpc_bk26-Sep-06 16:10 
Hi there,
Just want to add some information to the above two guys, basically there are a couple of ways that you can use to display data in the web page. You can write your code to pull data out of DB then display it in the web page by either setting the UI control's property or bind it to the data-bound control, and at least you need to write two lines of code in the case of data binding:
Line 1: control.DataSource = datasource;//set the DataSource property
Line 2: control.DataBind;//call the DataBind method to cause the binding

However, the new version of the ASP.NET, you no longer need to write this code any more. And the new set of data source controls such as SqlDataSource , ObjectDataSource controls ... will handle that for you. Though you can use the datasource control in code to pull data for example calling the Select method the accessing the IEnumerable result, you'd normally use it with the data-bound controls that have the DataSourceID property like GridView, FormView .... That being said, in the case of the controls that do not have the DataSourceID property like TextBox ... you can use your code (or the datasource control) to pull data, then set to the right property of the control in code or use the data binding expression (and remember calling the DataBind method), another option is to choose a container for it like FormView control so that you can configure using a datasource control like SqlDataSource.



GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish27-Sep-06 5:41
munklefish27-Sep-06 5:41 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
minhpc_bk27-Sep-06 15:37
minhpc_bk27-Sep-06 15:37 
GeneralRe: .NET2 Dispay data from SQL2005 Pin
munklefish27-Sep-06 22:33
munklefish27-Sep-06 22:33 
AnswerTHE SOLUTION Pin
munklefish27-Sep-06 23:47
munklefish27-Sep-06 23:47 
QuestionDataGrid Display Pin
Dayekh26-Sep-06 5:03
Dayekh26-Sep-06 5:03 
AnswerRe: DataGrid Display Pin
sanju027626-Sep-06 5:20
sanju027626-Sep-06 5:20 
GeneralRe: DataGrid Display Pin
Dayekh26-Sep-06 5:51
Dayekh26-Sep-06 5:51 
AnswerRe: DataGrid Display Pin
Suresh Pirsquare27-Sep-06 0:10
Suresh Pirsquare27-Sep-06 0:10 
QuestionGetting ColumnID Value from GridView? [modified] Pin
sanju027626-Sep-06 4:05
sanju027626-Sep-06 4:05 
AnswerRe: Getting Column Id Value from GridView? Pin
dgonzale26-Sep-06 4:14
dgonzale26-Sep-06 4:14 
GeneralRe: Getting Column Id Value from GridView? Pin
sanju027626-Sep-06 4:17
sanju027626-Sep-06 4:17 
AnswerRe: Getting Column Id Value from GridView? Pin
dgonzale26-Sep-06 4:24
dgonzale26-Sep-06 4:24 
QuestionCrystal Report in ASP.Net 2.0 Pin
Mazdak26-Sep-06 3:56
Mazdak26-Sep-06 3:56 
QuestionFind the Source of PostBack Pin
Jay_se26-Sep-06 3:30
Jay_se26-Sep-06 3:30 
AnswerRe: Find the Source of PostBack Pin
_AK_26-Sep-06 6:50
_AK_26-Sep-06 6:50 
GeneralThanks It Works Fine & One More Query Pin
Jay_se26-Sep-06 20:56
Jay_se26-Sep-06 20:56 
Questiongetting html hidden control's value in code behind Pin
max_dev2006@yahoo.com26-Sep-06 2:41
max_dev2006@yahoo.com26-Sep-06 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.