SQL Server :: Which One Is Better To Work With In Sql And VS.net - Money Or Decimal
Aug 18, 2010
I want a field to keep money value (up to 100,000,000.00). And I didn't work with money or decimal data type. Money data Type is 8 byte Decimal (9, 2) is 5 byte. (Exactly msdn only say Decimal (9, 0) is 5 byte and I don't really know how byte is Decimal (9, 2)) which one is better to work with in sql and VS.net (handling sql in VS)
i am working on a product based website in which i have a product table with product names and prices, i have defined the datatype of price as "Money"
but the problem is it shows price upto 4 decimals everytime, how i can limit that upto 2 decimals only, on the webpage as well as in the table also in database ?
I have a table in my SQL Server db with fields of money datatype. It seems as though SQL Server likes to have 4 decimal places for the money datatype, but is there any way in the settings of this table or that money field to change this to 2? I know how to programmitically trim the last two zeros, if I can manually set something so I don't have to do this every time I retrieve the money datatypes from the database table.
i hav one data table in which some decimal values are up 6 decimal places.. im trying to bind that Data table to DataGridView while binding i want to round decimal values up to two decimal palces here is my code
dt.Columns.Add("Orderid", typeof(string)); dt.Columns.Add("tagnumber", typeof(string)); dt.Columns.Add("Minimum Value", typeof(string)); dt.Columns.Add("Maximum Value", typeof(string)); int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++)
I was read your post: "Export GridView to Excel in ASP.Net with Formatting using C#" and is very useful. That code works perfect. But I need create a new format for a specific column in my sheet before to export it. For example:My DataTable have a column with decimal numbers and I'm trying reduce the tenths for each number.I want this: 2,874444 ----> 2,87 for a specific range. In this case I need it for all numbers in the column 13 or well said for the Column called N in Excel. Only reduce two tenths.
I'm trying to execute this statement every minute with SQL Agent, I have it set up as a job:
[Code]....
It's trying to update a column which data type is set to decimal. Just so you know what I really need out of it, here is an example:
[Code]....
The answer of which should add on 0.5 to the original value. If I were to use the increase value of 60 which then becomes 60/60 it will work.I'm dividing by 60 because the increase value is per hour so I make it smaller to get per minute value. Why is it doing this?
I have a variable with a decimal type. When I save this value in the data base, the value is rounded.
For example, in VS.Net I have the value 15.15 and in my data base it was save as 15. Other example, if the value is 88.88 in VS.Net, it is saved as 89 in the data base.
I keep the same decimal type in all the variables in the three tiers of the application.
The field in the database is decimal type too.
What data type do I have to use in VS.Net and in SQL Server database for decimal values? I need a data pression of 4 decimals at least.
Using sql server and trying to insert decimal values using a ASP.NET C# code. I get the value for hours from a text box through user input and I'm trying to insert it to the database.
strSQLWAUpdate = " UPDATE Project SET WAHours='" + txtWAHours.Text + "' WHERE WAProjectID='" + hidWAProjectID.Value + "' ";
What happens is it rounds off the hours to interger value. So if I insert 22.3 in the text box what i get in the database is 22 and if I insert 22.7 I get 23 in the database. I do not need any rounding but need to get the values as it is. ( that is 22.3 and 22.7 respectively)
i have this validation for money value in textbox ^d+(.d{1,2})?$.Its working fine. for example if i enter 23.10 its fine.but if i give .10 it does not work.I want this to be worked if i dont put any ineteger before the decimal point like .20.
I have latitudes and longitues in a table but they are in a nvarchar(50) field althought the values are like this -> 39.7355 I need to be able to convert those values to numeric to execute a calculation and update a new field
I am working on a multi-language web site. It is half English and half Portuguese. I have created forms that have portuguese values in it. These forms work perfectly on my desktop. I'm using Cassini as the development server. When I move them over to IIS, they are not loading properly. The text comes up all weird looking. I am declaring the culture in the page attribute: Culture="pt-BR"
The problem is that, how to return OUTPT value to dTtoal and the remaining. Because now it's show assigned values as 1, 2, 3, 4 resp. I mean the bold values.But, if I execute SP using EXEC then it works fine, shows result correctly.
I am using gridview for adding invoices dynamically.And I am set the column as auto generated column.How can i set alignment as right for money column.And how to i specify money value for that column.
I have a search screen where there are total 15 search fileds...one among them is amount range (money datatype)...using Between keyword i am trying to filter the search results...problem is it is taking more time to fetch the records...if i comment only money range in where condition and all other remain same..then it is returning in 2 seconds for 25 records...otherwise it is taking around 31 seconds to return 25 records..
im trying to dcreate a requiredfieldvalidator that only accept amount of money.
first i used this expresvalidator as it cant receive any letter.
<asp:RegularExpressionValidator ID="rvcheckno" runat="server" ErrorMessage="Amount receive numbers only!" ControlToValidate="tbamount" InitialValue="0" ValidationGroup="number"> </asp:RegularExpressionValidator> but then it also cant receive cent.
i was trying to do something that can accept 130.00