you can use ADO.net to retrieve data from database.
If you want only single value from database to display in
Textbox
then you can use
ExecuteScalar()
...
I am assuming you are using SQL server database.. Follow this link :
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executescalar.aspx[
^]
If you want to use Stored Procedure instead of Inline query then set
CommantType
attribute as given below...
System.Data.SqlClient.SqlCommand objCommand = new System.Data.SqlClient.SqlCommand();
objCommand.CommandType = System.Data.CommandType.StoredProcedure;
Hope this will help...