Discussion:
VB.NET not updating Access properly
(too old to reply)
dpaulovich
2010-10-26 15:41:31 UTC
Permalink
?I am taking data from a datagridview and storing it in an Access 2007 DB
table
using the Datatset/TableAdapter Update command.


'Add rows to Table'

FoodDatabaseDataSet.Meals.Rows.InsertAt(DR, MealsRwCnt)


'Update Data Base'


Try
Me.Validate()
MealsBindingSource.EndEdit()
MealsTableAdapter.Update(FoodDatabaseDataSet.Meals)
Catch ex As Exception
MsgBox(ex.ToString)
End Try


The update works fine storing all data in the Access DB table. The problem
I'm having
is that the data is stored in the DB in integer format instead of decimal
format
(anything less than zero is stored as a zero)

While the app is running and after an update, on another datagridview
populated by the DB data, data is diplayed in decimal format.
It appears that the Dataset.DataTable is updated correctly but not the
ACCESS DB table.


Any help will be appreciated

Thank You
dpaulovich
2010-10-26 19:56:48 UTC
Permalink
?I figured out the problem. Had to set the "Scale" parameters in the Access
database fields.

The "Scale" parameter determines the number of places to the right of the
decimal place.

Learn something new every project.







"dpaulovich" wrote in message news:tK-***@giganews.com...

?I am taking data from a datagridview and storing it in an Access 2007 DB
table
using the Datatset/TableAdapter Update command.


'Add rows to Table'

FoodDatabaseDataSet.Meals.Rows.InsertAt(DR, MealsRwCnt)


'Update Data Base'


Try
Me.Validate()
MealsBindingSource.EndEdit()
MealsTableAdapter.Update(FoodDatabaseDataSet.Meals)
Catch ex As Exception
MsgBox(ex.ToString)
End Try


The update works fine storing all data in the Access DB table. The problem
I'm having
is that the data is stored in the DB in integer format instead of decimal
format
(anything less than zero is stored as a zero)

While the app is running and after an update, on another datagridview
populated by the DB data, data is diplayed in decimal format.
It appears that the Dataset.DataTable is updated correctly but not the
ACCESS DB table.


Any help will be appreciated

Thank You

Loading...