.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!



Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

display total records in textbox?

Posted By: Rama Krishna     Posted Date: August 16, 2009    Points:2   Category :C#
in page i took textbox, myrequirement is on page loading time i want to call stored procedure "getcontactsrecords" to display all contact names in textbox(C# code)

Responses
Author: Akhil Raj       [Moderator]      
Posted Date: August 17, 2009     Points: 5   

hi friend,
I didn't got clearly. How you ddisplay all names in one textbox.. Any listbox or something like that? Anyway in the loading time you can the stored proc in the page_Load event

Author: Rama Krishna             
Posted Date: August 17, 2009     Points: 5   

all names are separated by commas like mailform model

Author: Akhil Raj       [Moderator]      
Posted Date: August 17, 2009     Points: 5   

k then you can add the code in page_load event. After the get the values ... you add to textbox with comma

Author: Rama Krishna             
Posted Date: August 17, 2009     Points: 5   

all names are separated by commas like mailform model

Author: Rama Krishna             
Posted Date: August 17, 2009     Points: 5   

all names are separated by commas like mailform model

Author: Akhil Raj       [Moderator]      
Posted Date: August 17, 2009     Points: 5   

hi rama why you are posting the same messages again and again... If you dont get my post please ask the doubt in that. Surly will help you

Author: Syed Shakeer Hussain             
Posted Date: August 17, 2009     Points: 5   

Hi
write the belowcode in PageLoad event:

SqlCommand cmd = new SqlCommand("getcontactsrecords""))
{
cmd.CommandType = CommandType.StoredProcedure;
conn.Open();
cmd.Connection = conn;

SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
{
textbox1.text="";
while (rdr.Read())
{

textbox1.text += rdr.GetString(rdr.GetOrdinal("FirstName"));

}
rdr.Close();
}
}

Author: Rama Krishna             
Posted Date: August 17, 2009     Points: 5   

sorry akhil,on refreshing time,and pressing time of back and front buttons,it is automatically resend.



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend