Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

decimal value doesn't get stored in MS access when passed from vb.net

Status
Not open for further replies.

trimakassi

Programmer
Aug 5, 2005
20
MA
i am trying to store a numeric value in a textbox in a msaccess field.
the field is numeric simple real type

code:

Dim dr As System.Data.DataRow = Ds1.Table(0).NewRow

dr("number") = cdbl(txtnum.text)
Ds1.Tables(0).Rows.Add(dr)
OleDbDataAdapter1.Update(Ds1)
OleDbDataAdapter1.Fill(Ds1)
Me.Refresh()


my problem is that 12.43 gets stored as 12. 12.50 gets stored as 13. I want 12.5 to be stored as 12.5

thanks
trimakassi
 
Change the datatype in MS Access field to "Number" and fieldsize to "double"

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
thanks abdulla

I actually changed the datatype in msaccess field to decimal with estimate 2 and converted the textfield to decimal before updating my dataset and it worked fine.


thank u though

have a nice one
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top