Creating a WinForm (C#.NET 4.6). I believe this is more of a C# coding question than a SQL question?
I'm saving data to a SQL Server database. My C# code is using "transaction.Commit()", so I can perform a "transaction.Rollback()" if there's an issue. My code is looping through rows of a DataTable, to save data to the database. After I call "transaction.Commit()", I clear the DataTable. I'm wondering if the process is waiting for "transaction.Commit()" to fully complete, before the line of code (dataTable.Clear()) is executed? As you can imagine, I don't want to clear the DataTable until the SQL process has fully completed.
thanks
Ron
I'm saving data to a SQL Server database. My C# code is using "transaction.Commit()", so I can perform a "transaction.Rollback()" if there's an issue. My code is looping through rows of a DataTable, to save data to the database. After I call "transaction.Commit()", I clear the DataTable. I'm wondering if the process is waiting for "transaction.Commit()" to fully complete, before the line of code (dataTable.Clear()) is executed? As you can imagine, I don't want to clear the DataTable until the SQL process has fully completed.
thanks
Ron