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

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

StringBuilder in class file using C#.net

Posted By:Narayanan       Posted Date: March 28, 2012    Points: 40    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

Here I will give a code for Declare stringBuilder class in the Class file and Call tat class file in the Form class .

I create a Class file in my Project. It's Name Master.cs

class Master

        public int TestId { get; set; }
        public string TestName { get; set; }
        public StringBuilder  result = new StringBuilder();
In Form contains Two Textboxies  and One Command Button. call a Class when user clicks a command button event.

     Master mst = new Master();
            mst.TestId = Convert.ToInt32(txtId.Text);
            mst.TestName = txtName.Text;
          mst.result.Append( "Id No:" + mst.TestId + " " + "Name" + " " + mst.TestName);


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

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