HighTechTalks DotNet Forums  

VB.NET not updating Access properly

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss VB.NET not updating Access properly in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
dpaulovich
 
Posts: n/a

Default VB.NET not updating Access properly - 10-26-2010 , 10:46 AM






?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

Reply With Quote
  #2  
Old   
dpaulovich
 
Posts: n/a

Default Re: VB.NET not updating Access properly - 10-26-2010 , 02:54 PM






?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:CuWdnbRGiYpLalvRnZ2dnUVZ_omdnZ2d (AT) giganews (DOT) 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

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.