Click here to Skip to main content
15,913,128 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRadio Button Pin
sweetemmu28-Feb-07 23:10
sweetemmu28-Feb-07 23:10 
AnswerRe: Radio Button Pin
Tuwing.Sabado28-Feb-07 23:14
Tuwing.Sabado28-Feb-07 23:14 
QuestionReally simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
AdamskiR28-Feb-07 23:08
AdamskiR28-Feb-07 23:08 
AnswerRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
gauthee28-Feb-07 23:52
gauthee28-Feb-07 23:52 
GeneralRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
AdamskiR1-Mar-07 0:00
AdamskiR1-Mar-07 0:00 
GeneralRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
gauthee1-Mar-07 0:15
gauthee1-Mar-07 0:15 
GeneralRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
AdamskiR1-Mar-07 0:31
AdamskiR1-Mar-07 0:31 
AnswerRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
Harini N K1-Mar-07 0:20
Harini N K1-Mar-07 0:20 
Hi
There are lots of examples for form view using SQL Data Source. Here is an example to bind data in labels using VS.Net 2005 (C#.net 2.0)

Simply drag and drop SQL Data source in your application. Right click the Data source, click Configure Data Source. If this is the first time you are connecting to Database then Click New connection, Type Server Name, User Name & Password. Select database from the list after entering valid user name and password.

Connection String will be populated automatically in the list. Click next, select table from the list. You can modify your query later using the SELECT property of SQLDataSource.

If you don’t want SQLDatasource, you can add a connection string in Web.config and use the same. No need to worry about that now. You need to explore more on this.

For beginners, use SQL Data source. Try without DataSource later as most applications use Stored Procedures.

Now add Form or Details or Grid view in your application; go to DataSourceID property of the control (formview or detailsview or gridview). Select DataSourceID from the list as you have added in your application.

By default all fields will be bind automatically.

Just take a note: .net uses the following expression for binding text:

1.	<%# DataBinder.Eval(Container.DataItem,"columnname"%> - for gridview
2.	<%# Bind("Columnname") %> - for formview or detailsview 
3.	<%# Eval("Columnname") %> - for formview or detailsview 


Try other controls like GridView. All the best




Rate this message. Thank you. Harini Smile | :)

GeneralRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
AdamskiR1-Mar-07 0:40
AdamskiR1-Mar-07 0:40 
AnswerRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
Paddy Boyd1-Mar-07 0:40
Paddy Boyd1-Mar-07 0:40 
GeneralRe: Really simple, but im missing something?! Binding to a label from a datasource in .net2 c# Pin
AdamskiR1-Mar-07 0:46
AdamskiR1-Mar-07 0:46 
Questionquestion about grid view Pin
legend_of_zanado28-Feb-07 22:56
legend_of_zanado28-Feb-07 22:56 
AnswerRe: question about grid view Pin
gauthee28-Feb-07 23:56
gauthee28-Feb-07 23:56 
QuestionDatatable + asp.net 2.0 + c# Pin
ritu432128-Feb-07 22:47
ritu432128-Feb-07 22:47 
Questionhow the sessions implemented? Pin
M.S.Senthil Kumar.28-Feb-07 22:44
M.S.Senthil Kumar.28-Feb-07 22:44 
AnswerRe: how the sessions implemented? Pin
Tuwing.Sabado28-Feb-07 23:05
Tuwing.Sabado28-Feb-07 23:05 
QuestionSending email message from asp.net webform Pin
anujose28-Feb-07 22:40
anujose28-Feb-07 22:40 
AnswerRe: Sending email message from asp.net webform Pin
swguy2328-Feb-07 22:49
swguy2328-Feb-07 22:49 
GeneralRe: Sending email message from asp.net webform Pin
anujose28-Feb-07 23:13
anujose28-Feb-07 23:13 
GeneralRe: Sending email message from asp.net webform Pin
swguy2328-Feb-07 23:17
swguy2328-Feb-07 23:17 
GeneralRe: Sending email message from asp.net webform Pin
anujose28-Feb-07 23:29
anujose28-Feb-07 23:29 
GeneralRe: Sending email message from asp.net webform Pin
anujose1-Mar-07 0:01
anujose1-Mar-07 0:01 
GeneralRe: Sending email message from asp.net webform Pin
swguy231-Mar-07 1:04
swguy231-Mar-07 1:04 
GeneralRe: Sending email message from asp.net webform Pin
anujose1-Mar-07 18:32
anujose1-Mar-07 18:32 
AnswerRe: Sending email message from asp.net webform Pin
Vasudevan Deepak Kumar4-Mar-07 2:24
Vasudevan Deepak Kumar4-Mar-07 2:24 

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.