L
Lori Markle via .NET 247
Hi, I already posted this but can't find it anywhere!
I'm having a problem that seems very simple. I'm trying to updatea db and am getting stuck on the data binding of a textbox. Iget a "Cannot bind to property or column permitnumber onDataSource" OR if I use ("text", ds, "permits.permitnumber")nothing happens except that a permit number that already existsshows up in the textbox. Do I have something in the wrong order?HEre is my code:
Dim dbConn As NewOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Projects\Tests\ParkingPErmits.mdb")
Dim da As New OleDbDataAdapter("select * from permits",dbConn)
Dim cb As New OleDbCommandBuilder(da)
Dim ds As New DataSet
da.UpdateCommand = cb.GetUpdateCommand
da.DeleteCommand = cb.GetDeleteCommand
da.InsertCommand = cb.GetInsertCommand
da.Fill(ds, "permits")
txtPermits.DataBindings.Clear()
txtPermits.DataBindings.Add(New Binding("text", ds,"permitnumber"))
da.Update(ds, "permits")
Thanks!
I'm having a problem that seems very simple. I'm trying to updatea db and am getting stuck on the data binding of a textbox. Iget a "Cannot bind to property or column permitnumber onDataSource" OR if I use ("text", ds, "permits.permitnumber")nothing happens except that a permit number that already existsshows up in the textbox. Do I have something in the wrong order?HEre is my code:
Dim dbConn As NewOleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Projects\Tests\ParkingPErmits.mdb")
Dim da As New OleDbDataAdapter("select * from permits",dbConn)
Dim cb As New OleDbCommandBuilder(da)
Dim ds As New DataSet
da.UpdateCommand = cb.GetUpdateCommand
da.DeleteCommand = cb.GetDeleteCommand
da.InsertCommand = cb.GetInsertCommand
da.Fill(ds, "permits")
txtPermits.DataBindings.Clear()
txtPermits.DataBindings.Add(New Binding("text", ds,"permitnumber"))
da.Update(ds, "permits")
Thanks!