L
Lori Markle via .NET 247
(Type your message here)
Hi,
I'm having a problem with binding a textbox to a dataset. Cananybody figure out what's going on here?
I simply want to update a record. Type in a permit number andsave it to the database. I get the "cannot bind to columnpermitnumber on datasource" error, or if I add the tablename.column name into the binding, a permit number that alreadyexists pops up.
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("text", ds,"permits.permitnumber")
da.Update(ds, "permits")
Do I have something in incorrect order?
Thanks,
Hi,
I'm having a problem with binding a textbox to a dataset. Cananybody figure out what's going on here?
I simply want to update a record. Type in a permit number andsave it to the database. I get the "cannot bind to columnpermitnumber on datasource" error, or if I add the tablename.column name into the binding, a permit number that alreadyexists pops up.
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("text", ds,"permits.permitnumber")
da.Update(ds, "permits")
Do I have something in incorrect order?
Thanks,