0

I have multiple rows in my SQL database table in which some column I am using for generating the bill, What I am doing is I am fetching all the rows in the list and loop through that list and for each loop row I am performing the calculation and saving it into the list and then saving that into the database.

Now my Question is . 1. Is there any other way to execute the task I mean a better way and 2. How can I insert multiple rows from my Asp.net MVC application into the database(Just need Idea ). 3. And in the end of above process I want to generate a PDF containing all bill information

Thanks in Advance

Amar
  • 53
  • 13

2 Answers2

1
  1. If you are using .NET 4.0 and above, you can user Parallel.ForEach. It uses all cores of the machine to finish the task. See this link.

  2. If you are using SQL Server 2008 and above, you can use Table-Valued parameter to pass multiple rows. See this answer for more detail

Community
  • 1
  • 1
Sanjay Sahani
  • 565
  • 4
  • 14
0

.3. To generate PDF you can use Free Spire.PDF for .NET

mashet
  • 836
  • 1
  • 10
  • 17