I have a form with 3 textboxes and aslo other tools. in these 3 have decimal values.
in databse ,table have 4 fields (name varchar(),qty decimal(),value decimal(),price decimal()) named item
When we insert the the textbox values into the databse it passes only integer part values not decimal points. i use storedprocedure.
I use the code like
cn.insert( textbox1.text,Convert.ToDecimal(textBox2.Text), Convert.ToDecimal(textBox3.Text), Convert.ToDecimal(textBox4.Text))
but it takes only integer part. how we insert decimal point values ? plz help.
Loading
Sandeep ShekhawatPosted Jun 28, 2011, 1:04 AM
I think you table field will be like decimal(18,0) u simply change this decimal(18,2). then u will get fraction part.if u want more than two digit after point then change decimal(18,4) like any number u want.
Vilas GitePosted Jun 28, 2011, 1:19 AM
refer..
http://msdn.microsoft.com/en-us/library/f02979c7.aspx
---------------------
If this reply hepls your post…then "MARK AS ANSWER"!
Vilas GitePosted Jun 28, 2011, 1:17 AM
use TryParse
some like below...
double dItem1Qty;
double.TryParse(Item1Qty.Text, out dItem1Qty);
Item1Qty.Text = dItem1Qty.ToString();
------------
If this reply hepls your post…then "MARK AS ANSWER"!