Click here to Skip to main content
14,638,971 members
Rate this:
Please Sign up or sign in to vote.
See more:
tablename User

Id           int                   
Email         varchar(500)
Password       varchar(500)
Name            varchar(500)


DATA IN TABLE IS
Id Email          Password Name 
1  ali@yahoo.com   1234     ali
2  usman@yahoo.com  1234    usman


i ask you about simply how datatable working
is
Label1.text=datatable.Rows[0]["Name"].Tostring();
for Row ali@yahoo.com 1234 ali
and Label1.Text=datable.Rows[1]["Name"].Tostring(); is for row usman@yahoo.com 1234 usman


1 ali@yahoo.com 1234 ali          // is this is row 0?

2   usman@yahoo.com  1234  usman      // is  this is row1?
Posted
Updated 8-May-11 22:05pm
v4

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Take the ID in session. And in Pageload make a query and fetch the name with respect to id like "Select * from User where Id='+Session["ID"].Tostring()+"'".

And then Label1.text= ....... .


Hope this can help you.
   
v2
Comments
umairshoaib 9-May-11 3:48am
   
i undestand kown about Datatable.Rows[0] how it works

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100