Using ODP.NET to Insert Multiple Rows within a Single Round Trip
page 4 of 4
by Steven Swafford
Average Rating: 
Views (Total / Last 10 Days): 40593/ 136

See It In Action

[Download Sample]

Execute the Application

Now that we have completed the steps necessary to design the Web form and create the appropriate methods to handle interaction with the database, it is time to test. Within the Visual Studio .NET IDE, press the F5 key to run the application.  Enter test data and click the Add Authors button. If the insert into the database is successful, a screen similar to the following should be displayed.

Figure 11 – Success Web Form Execution

Figure 11 – Authors Web Form Successful Execution

To take this a step further, query the database to ensure the data was successfully inserted.

Figure 12 – Database Query Results

Figure 12 – Database Query Results


As you can see, using the ArrayBindCount property allows the developer to make a single call to the database using a stored procedure or SQL statement. The beauty of this is that the execution happens at the database level with a single call versus a loop, which would require a total of three round trips. While this may not be feasible in every situation, e.g., where you do not know ahead of time how many rows will be processed, it is a perfect solution for those times that you do know how many rows you are to process.

Additional Reading

Using Oracle Data Provider for .NET

Oracle Data Provider for .NET Developers Guide (Requires Free Registration)

Access Oracle-Specific Features

Feel free to discuss this article at my Blog.

View Entire Article

User Comments

No comments posted yet.

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2020  |  Page Processed at 2020-07-04 7:52:54 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search