Decimal DataType Question

What would I have to set the Decimal DataType's precision value to to accept:

5.5
0
1.5
3.5
etc...etc...?

Matt Brown
MetalReview.com - Metal music community and reviews
Haulix - Easy promotional media distribution for the music industry
0
mattb
9/6/2003 7:02:41 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

3 Replies
397 Views

Similar Articles

[PageSpeed] 55

How large will the largest number be?  Is there always at most a single decimal?

decimal(9,1) would work if you never have more than a single decimal palce. This would take up 5 bytes of storage, and nothing smaller would save you any space, so I would certainly leave it at that even if the number of digits to the left of the decimal (whole numbers) never exceeds 1.
Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
0
douglas
9/7/2003 8:27:22 PM
I've been experimenting and I think (4, 1) is going to work for me.

I just needed 0, 0.5, 1, 1.5, all the way up to 6.
Thanks!
Matt Brown
MetalReview.com - Metal music community and reviews
Haulix - Easy promotional media distribution for the music industry
0
mattb
9/7/2003 8:32:41 PM
That is good, but keep in mind that even (4,1) is going to use the same 5 bytes of storage that (9,1) will.  If there is ever any change of it getting larger, the extra space will not cost you anything.

Glad you got it going!
Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
0
douglas
9/7/2003 8:34:42 PM
Reply:

Similar Artilces:

convert ado.net datatype to sql datatype
I have included the code that converts ado.net datatype to sql datatype. The columns belong to the dataset. However I want to know if there is a more direct method of dealing with this instead of multiple if then else or switch case statements.  If column.DataType.ToString = "System.Double" ThencolumnType.Add("bigint") ElseIf column.DataType.ToString = "System.String" ThencolumnType.Add("ntext") ElseIf column.DataType.ToString = "System.DateTime" ThencolumnType.Add("datetime") Else : columnType.Add(column.Dat...

CLR.NET datatype for decimal is System.String or Decimal
CLR.NET datatype for decimal is System.String or System.Decimal the documentation says System.string while it is mapped to DbType.decimal I need some understanding on this. any help thanks vsv ...

SQL in .NET question
How do i use the LIKE and the wildcards in a search in .NET (using c#) example in straight SQL: SELECT * FROM myDB WHERE LastName LIKE '%Jo%' if i try and use it in .NET like follows: SELECT * FROM myDB WHERE LastName LIKE %@MyVar% I get an error. Try: SELECT * FROM myDB WHERE LastName LIKE @MyVar and then prepend and append '%' characters to the string you are passing in.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Wow, I didn't know you could do that. I usually do this which works as well (no prepending of...

To .NET or not .NET, that is the question
I'm running WinXP pro 32-bit, meaning I've got the version 1-dot-something of .NET that XP came with. I've been looking for various softwares, and more and more often come across .NET version 2 being prerequisite. No urgency for me re. my questions to this group - so far I have just decided to hit the red X on those download pages - but the desire for this newer version of .NET seems to be growing for me. Firstly, according to my (limited) research, newer .NET versions are inclusive of the previous ones, and the current version seems to be 3.5. So if I go for i...

sql insert .net question
Hello, wrote an insert for a C#.Net web app. The insert works fine, except if there are appostrophies (spelling) for example: this isn't a problem this isnt a problem the second one will work the first will not. The info is going into a sql server database as text(16), the same result occurs with char. I believe you'll need to use an escape character "\", so something like this: "this isn\'t a problem" Also, you should try to use stored procedures or at the very least paramater queries. Both of those would solve your problem as well."I would l...

Converting a gridView using an Sql Datasource to a gridview who is not using an SQL DataSource
How can i rewrite this page so that i doesnt make use of an SqlDataSource?  <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginHistory.ascx.cs" Inherits="Private_UserControls_WebUserControl" %> <html> <head> <%--<link rel="stylesheet" href="BaldwinPortal.css" mce_href="BaldwinPortal.css" type="text/css" />--%> <title>Login History</title> </head> <body style="margin:0 0 0 0;padding:0 0 0 0"> ...

SQL Question: Updating from decimal to integer
Ok so I have an editable grid containing a delivery driver's route (delivering newspapers). One of the fields is "Delivery Order" (used to order the delivery sequence). So the table looks like the followingLocationID, DeliveryOrder, Address, EtcMy problem is when the user updates the delivery order by "adding a new delivery location" they have to enter a decimal to fit it in the spot they want. For example, if they have a location that needs to fit between the first delivery location (Location 1) and the second (Location 2) the user would need to enter a delivery orde...

A question about the Sql Server Decimal Data Type
I am a little confused about the Decimal Data Type in SQL Server. Why is the following SQL Ok: declare @foobar Decimal(6,2)select @foobar = 123.00select @foobar Yet this SQL throws an arithmetic overflow error: declare @foobar Decimal(6,4)select @foobar = 123.00select @foobar Didn't I make the decimal larger in the second example?  I also have one other question (which was the reason that I was playing around in the first place).  I have read that the 'precision' is the maximum number of digits that can be stored to the left and to the right of the decimal point. T...

Possible Bug in SQL DataLayer (decimal datatype)
I've been working on a custom module for my company. I'm having an issue in 2 of my tables. I have datatypes of Decimal in my tables, Everytime i call Plan = CType(CBO.InitializeObject(Plan, GetType(HostingPlansInfo)), HostingPlansInfo) i get a weird reflection error. I guess i'm wondering if the datalayer can support a decimal datatype and tinyint datatypes. I've re-generated all my stored procedures, business objects, and the dataproviders. Any idea on this? Error: Hosting Plans Admin is currently unavailable. DotNetNuke.ModuleLoadException: Object type cannot be converted ...

quick question about SQL server 7 datatypes
What is the equivilent datatype in SQL server 7 for the Access database memo field? textThanks,Teemu KeiskiFinland, EU...

Interview Questions on C#, SQL & .NET OOPs
Hi Guys I've compiled some notes & Interview Questions on C#, SQL & .NET OOPs... If interested you may read them at http://moredotnet.googlepages.com Cheers!       Vishal Khanna.NET Interviews & FAQs @ www.dotnetUncle.comClick Mark as Answer if the reply helped you. As someone who does a lot of interviewing, it's always a pleasure to see posts like these, as it gives me a chance to refine my questions to make them much harder. However, in this case, I'm a little less worried because the incompleteness of the answers (and some of them are just plain w...

What is the difference between Numeric And Decimal Datatype in Sql server 2005
Hi, I want to know What is the difference between Numeric And Decimal Datatype in Sql server 2005PLZ HELP ME.RAGHAV MVP ASP/ASP.Net Read My Blog MARK THE POST AS ANSWER IF IT HELPS U. "Success doesn't come to you…you go to it."--Marva Collins "Success does not come to those who wait . . . and it does not wait for anyone to come to it." Anonymous Fromhttp://msdn.microsoft.com/en-us/library/aa258271.aspx numeric is Functionally equivalent to decimal.Mohamed Abb@s------------------------Please remember to click “Mark as Answer” on the post(s) which helps you...

SQL Server Reporting Services for SQL SERVER 2000 AND Visual Studio.NET 2005 .NET 2.0
Hi, Which version of SQl Server Reporting Services will work with SQL SERVER 2000 in pararrel with ASP.NET 2.0 (.NET 2.0 framework)?  Thanks, Azam HighOnCodingWanna get high! Hi, Okay I got the answer. Yes, we can use the SQL SERVER 2005 Reporting Services with SQL SERVER 2000. HighOnCodingWanna get high! ...

Question involving PL/SQL datasource used for report
Here is a query that can be run in PL/SQL Developer that assigns String type to a parameter named "ThisParam".    select &<name=ThisParam type=string> from dual   I tried using this in SSRS:  select :<name=ThisParam type=string> from dual ,  but it generates an error. In SSRS, is there an equivalent way to assign a type to a parameter?  Thanks.                   Hi,  For SQLServer reporting service, you can try the following code which is in TSQL...

Web resources about - Decimal DataType Question - asp.net.sql-datasource

Datatype generic programming in Scala
... level fixpoints and how it can be used to define generic abstractions like catamorphism and anamorphism . These are used extensively in datatype ...

Sabbatical week day 3: Raining datatypes
... 2: I fail at Octave (swizec.com) Learning me a Haskell (swizec.com) Non-Sabbatical (ringingtrue.net) How to insert a file to an Image datatype ...

Integer - Wikipedia, the free encyclopedia
) are formed by the natural numbers (including 0) ( 0 , 1 , 2 , 3 , ...) together with the negatives of the non-zero natural numbers ( −1 , −2, ...

CHARITY - Home Page
Charity is a categorical programming language currently beingdeveloped by The Charity Development Group in The Department of Computer Science ...

Adobe Director 11.5: Upgrade details
Accessibility Adobe Products Acrobat Creative Cloud Creative Suite Digital Marketing Suite Digital Publishing Suite Elements Photoshop Touch ...

Anzo Express - Cambridge Semantics
Semantic collaboration platform providing secure data integration, collaboration, and reporting in Microsoft Excel and on the Web.

Betting the Company on Windows 8
... and create something far less expensive than a PC which is powerful enough for Web browsing. This new platform would optimize for the datatypes ...

Q&A: SQL Date format for credit card - TechRepublic
Hi There, I am very new to MySQL and am creating a database for online payments etc. What datatype do I need to use for the credit card expiry ...

Data types - DBMS 2 : DataBase Management System Services
Analysis of data management technology optimized for specific datatypes, such as text, geospatial, object, RDF, or XML. Related subjects include: ...

Functional Programming with Python – Part 1
... instances wherein any modifications to the string result in a new String instance being created. Imagine the same happening to all the datatypes ...

Resources last updated: 12/8/2015 9:03:12 PM