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


Top 5 Contributors of the Month
david stephan

Post New Resource Bookmark and Share   

String Concat

Posted By:Majith       Posted Date: September 06, 2010    Points: 5    Category:    URL: http://www.dotnetspark.com  

This code is replacement of '+' operator into string.concat().
 

In C# there are lot of coding functionality uses + operator to concatinating the strings.

For performance we can use string.concat() method instead of that.If the string operations are to large then we can use sting builder.

 Sample Code:

  DataRow [] dr = dt.select("EmpId=' " + txtEmpId.Text + " ' ");

 Replacement Code: 

  DataRow [] dr = dt.select(string.concat("EmpId=",txtEmpId.Text));

 Regards! 

 

 

 

 

 

 

 


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Here

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