Update Datatable and DatagridView with database Changes by Timer
<p>Scenario : i have a database table that is being updated frequently by some services.</p>

<p>I have a c# Winforms Application that load this table in a datagridview by binding a datatable as Datasource, then i whant to add a Timer that every 10 seconds update a the content of a datatable with the last changes in the database table ...</p>

<p>I don't need to update a database with the datatable changes, but i need to update datatable with the last changes in the database table, that is the inverse of the usually.... </p>

<p>Is there a way to do that ? What is the best way ?</p>

<p>i've tried with this code : </p>

<pre><code>private void ServiceTimer_Tick(object state)
{
    OdbcConnection oCon = new OdbcConnection();
    oCon.ConnectionString = ConnectionStrings;
    OdbcDataAdapter dp = new OdbcDataAdapter("SELECT * FROM table", oCon);
    dsProva.Tables.Clear();
    dp.Fill(dsProva,"table");

    dataGridViewMessaggi.DataSource = dsProva.Tables["table"];
    dataGridViewMessaggi.Refresh();
}
</code></pre>

<p>But every Timer Tick i lost the selection in DatagridView and Current Row .... </p>

<p>Is There a better solution ?</p>
