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

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.