Hi,
Try this
oAD.Update(oDS, "tblItem")
Ken
-----------------
Hello!
I'm having a problem getting this functionality working and was hoping
someone could point me in the right direction.
I'm using VB.NET 2002 and I'm trying to dynamically bind an access db
table to a datagrid and then save changes made to the data in the grid.
My form constructor looks like this:
' sConnection, oAD, and oDS are previously defined
Dim oCon As New System.Data.OleDb.OleDbConnection(sConnection)
oCon.Open()
Dim sCommand As String
sCommand = "SELECT * FROM tblItem"
oAD = New System.Data.OleDb.OleDbDataAdapter(sCommand, oCon)
Dim oBuild As New System.Data.OleDb.OleDbCommandBuilder(oAD)
oAD.UpdateCommand = oBuild.GetUpdateCommand()
oDS.Clear()
oAD.Fill(oDS, "tblItem")
Me.DataGrid1.DataSource = Me.oDS.Tables("tblItem")
And then under my save button, I've got the following:
Try
oAD.Update(oDS)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
The message I get is "Update unable to find TableMapping['Table'] or
DataTable 'Table'." I thought that assigning the datasource using
Me.oDS.Tables("tblItem") uses a datatable object.
Does anyone have any suggestions?
Thanks in advance!
Michael
Michael - 23 Jul 2004 16:58 GMT
Thanks, Ken -- it works great now.
It's always the silly things. I need to get used to the overloaded
functions in vb.net.
Michael
"Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in news:OptrAfLcEHA.716
@TK2MSFTNGP11.phx.gbl:
> Hi,
>
[quoted text clipped - 4 lines]
> Ken
> -----------------