Note that there are some explanatory texts on larger screens.

plurals
  1. POComparing datatables / identify identical datatables
    text
    copied!<p>I am working with VB.net and mysql, I have a function which fills a datatable with mysql content then posts it (as appropriate) to a listview. This function is currently on a timer which activates every 5 seconds which unfortunately does horrible destruction to the drag-and-drop features of my software.</p> <p>The solution: I have decided after filling the content to the listview to copy the content from the active datatable to another datatable for comparison, every time the data is taken from the mysql db have it save to a datatable and compare the two datatables - if they are not identical the software should run the function however if they are identical there is no reason to update the listview with the same exact data.</p> <pre><code> Public pendrun As New DataTable Public postrun As New DataTable Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick con.ConnectionString = "server=localhost;" _ &amp; "user id=user;" _ &amp; "password=password;" _ &amp; "database=DMT" adptr = New MySqlDataAdapter("Select * from data", con) Try adptr.Fill(pendrun) Catch err As Exception Dim strError As String = "Exception: &amp; err.ToString()" End Try if pendrun &lt;&gt; postrun then ListView2.Items.Clear() pendrun.Clear() ' commands to add ' pendrun datatable information ' to listview postrun = pendrun 'to transfer data to the holding datatable end if </code></pre> <p>the problem is </p> <pre><code>if pendrun &lt;&gt; postrun then </code></pre> <p>is not a valid way to compare datatables. How do I identify if the datatables are identical (all rows and columns identical)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload