|
-
May 26th, 2007, 04:34 PM
#1
Thread Starter
Addicted Member
ado.net datagridview update problem
I have been searching all day and have seen a lot of people with the same problem, but no answer. I just have a basic table that I show in a datagridview. I want the use to be able to update anything, click a button and the updates get sent back to the database. This was so easy with recordsets in old ADO. Please help, I am sooooo frustrated..
Private adStations As New OleDbDataAdapter
Private Stations_Table As New DataTable()
Dim CN As New OleDbConnection("PROVIDER=Microsoft.Jet.oledb.4.0;" & _
"data source=" & DB_PATH)
adStations = New OleDbDataAdapter("SELECT * FROM stations", CN)
Stations_Table = New DataTable(sStationsTable)
' === Populate a new data table and bind it to the BindingSource.
adStations.Fill(Stations_Table)
DataGridView_Stations.DataSource = Stations_Table
''=== user does his thing, click Update button .....
adStations.Update(Station_Table) '====> Errror
Error is: Update requires valida updatecommand
Thnaks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|