It sounds to me like you're passing the UN/PW to the DB to check if they're valid for a login and want to then get the UN back from the DB for the purpose of a welcome page.
This may sound silly but... why not simply use the UN that was entered in the first place instead of revisiting the DB for the information?
Alternately, if the DB contains additional information (such as full name in addition to UN/PW) then it should be a simple matter of using a select statement calling the full name column based on a match to the username column. Something along the lines of:
"SELECT fullName from LoginTable WHERE userName='" + providedUN + "'"
and of course providedUN is the username provided in the login process.
i dont know what should i do to call it from the behind code to make it display at the specific place..
sorry, i'm very2 new to this language..
should i use function?where should i put the select statement just like you say?
First, are you using one form/page to login and a separate form/page for your welcome? If so, you would need to look at various methods of passing a variable from the login page to the secondary page.
One such method is to pass the variable as a part of a ClientQueryString, however this is hardly a 'secure' method of passing unencrypted user information from page to page as it puts the information right there in the URL for everyone to see.
If, on the other hand, your login page is one and the same with your main page (which can be accomplished using ASP:Panels and simply hiding the login panel and showing the Welcome panel upon successful login) you can pass the variable directly within the same page as a local variable without the bother of moving it around between pages. This has the combined benefit of keeping the variable information masked from the user end and not requiring messy transferrance of information outside of the local scope.
Not sure if either option will do what you need but hope this helps :)