Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42225

VS 2008 How to refresh a single row with binding source

$
0
0
Hello,
Not much experienced with databases so I need help on refresh a row with binded datagridview.

This is my declarations:
Code:

    Private WithEvents bs As BindingSource = New BindingSource()
    Dim adp As Odbc.OdbcDataAdapter
    Dim ds As New DataSet

Filling grid:
Code:

            cmd = New Odbc.OdbcCommand(sql, cn)
            adp = New Odbc.OdbcDataAdapter(cmd)
            adp.Fill(ds, "adpdataset")
            bs.DataSource = ds

            With DataGridView1
                .DataSource = bs
                .DataMember = "adpdataset"
            End With

After, in program I change data in those database with native SQL commands and in other form.
When I return back to form with "my list" in datagridview remain old contents.

If I refill dataset my datagridview fall's to the first row.

Question is, can I somehow refresh a single (changed) row in datagridview through binding source that my view (position in datagridview) stay where it is and this row get actual contents from database?
How to do this?

Viewing all articles
Browse latest Browse all 42225

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>