Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

VS 2008 [RESOLVED] DGV+ binding source( table filled with OleDBDataAdapter) - call adapter Command

$
0
0
Hi!

Today I learned about the possibility to set the UpdateCommand, InsertCommand and DeleteCommand on the OleDbDataAdapter which I use to fill the datatable which through a binding source displays data in my DataGridView.
Now I wonder, and cannot find an answer. Do I have to call those methods manually, or are they bound to some internal event handlers?

Kind regards,
Andy

Before you ask for any code, here are the main parts:
Code:

myOleDBCommand.Connection = newConn
myOleDBCommand.CommandText = sSQL 'SELECT statment string
Dim dataAdapter As New OleDbDataAdapter(myOleDBCommand)
Dim myTab As New DataTable()
Dim insertCommand As OleDbCommand
insertCommand = New OleDbCommand("INSERT ...")
dataAdapter.InsertCommand = insertCommand
dataAdapter.Fill(myTab)
myGrid2BindingSource.DataSource = myTab
myGrid2.DataSource = myGrid2BindingSource


Viewing all articles
Browse latest Browse all 27189

Trending Articles



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