In My sql server table There is a 40000 records and i use the FOR LOOP(Looping) for 40000 Records There is a 7 FOR LOOPS inside main FOR LOOP so it take much time when i executing the query in my aspx page on submit button to check the all the records...
How Increase perfomacne give me some suggestion

Nitin SontakkeRank #264 · 9.6K reputationPosted Dec 18, 2016, 5:43 PM EST
Amit Kumar SinghRank #562 · 4.3K reputationPosted Dec 18, 2016, 4:58 AM EST
it's a good practice to use StringBuilder instead of connecting the strings. It can save the memory and improve the performance.
To improve the execution speed of a SQL query, please check my suggestions:
A link of How To Optimize SQL Query may help you:
http://msdn.microsoft.com/en-us/library/ms979196.aspx