Decimal Datatype

 How can i use decimal datatype for the following validation while creating table:

i want user to insert upto 3 digits before "." and  2 digits after "."

for example it should allow 123.23

but should not allow 1234.345 .

 

Please suggest....

0
Manisha
4/24/2009 6:42:26 AM
asp.net.mysql 1929 articles. 0 followers. Follow

5 Replies
601 Views

Similar Articles

[PageSpeed] 10

DECIMAL(3, 2)

0
dmj07
4/24/2009 8:14:41 AM

 Whem i use decimal(3,2) its showing the following error

Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
 

0
Manisha
4/24/2009 8:28:36 AM

how about -     numeric(3,2)

0
dmj07
4/24/2009 9:25:05 AM

 how about using mid function mid(text1.text, 1, 3)

0
Steammike
4/24/2009 9:29:53 AM

 Both the things(numeric and mid) not working..

0
Manisha
4/24/2009 9:51:24 AM
Reply:

Similar Artilces:

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 ...

MySQL with PB5
Hi, I need to develope an application using MySQL (ver max-3.23.49) with MyODBC (ver 2.50.39) and PB5. I found a serious problem as describe below: 1. I have a table says WireDiameter code char(10) PK, sizeinmm decimal(5,2), sizeininch decimal(5,3) 2. Create a screen with datawindow for maintenance. 3. When I key in sizeinmm = 0.15 and sizeininch =0.012 and save (dw_1.update() ), the value save to table become 1.5 and 1.2. It seems like PB has converted the value to scientific notation (like 1.50000+e02 or whatever..). Does anyone has any idea about ...

MySQL with PB5
Hi, I need to develope an application using MySQL (ver max-3.23.49) with MyODBC (ver 2.50.39) and PB5. I found a serious problem as describe below: 1. I have a table says WireDiameter code char(10) PK, sizeinmm decimal(5,2), sizeininch decimal(5,3) 2. Create a screen with datawindow for maintenance. 3. When I key in sizeinmm = 0.15 and sizeininch =0.012 and save (dw_1.update() ), the value save to table become 1.5 and 1.2. It seems like PB has converted the value to scientific notation (like 1.50000+e02 or whatever..). Does anyone has any idea about ...

MySQL
Currently have a site coded in PHP but the customer wants to go to .NET. Can I use the existing MySQL DB or am I required to use MSSQL? Thanks, Ken Check out this forum which is specialized for this kind of questions: ASP.NET MySQL forumBart De Smet [MVP] Visit www.msdn.be, www.bartdesmet.net...

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...

System.Net.Sockets.SocketException with MySQL Connector.NET
Hi. I already tried many things and spent already 2 days without any success. Please help or I'll hang myself.I am using MySql.Data.dll  ver. 5.2.5.0 (runtime v2.0.50727) from my project (library). It works great if i use it from WindowsApplication but once i use it same way in WebApplication, it keeps throwing: The attempted operation is not supported for the type of object referencedException Details: System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced .. AsyncResult ias = socket.BeginConnect(endPoint, null, null);.. (or w...

mysql and .net
Hi there, i am new to .net and i am trying to setup a simple form. I am an open source person and what i am asking can be done easily using php and mysql; but i need to know how to do this in .net project asap. i have three forms; form1 submit to the database and redirect to form2 and form2 submit to the database and redirect to form3. i want to grab mysql last inserted id from form1 to form2 while redirecting and pass it via the url. i am able to select from the database, but i don't know how to assign it to a variable; here is what i have so far: str2 = "select last_ins...

Net::MySQL
------=_NextPart_000_0026_01C30A6E.486AE070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Anyone run into this problem=20 $mysql->query(q{ INSERT INTO dbname (table_name) VALUES ( $var ) }); The problem is, when I assign a value to a $var that value is ignored in = the SQL statement. Ive tried every operator I know to get it to look at = it and accept the value as input into the DB. Ive tried=20 ( '$var' ) ("$var") ("\$var") ([$var]) ({$var}) Any ideas ? Kind regards...

decimal datatype
Hello , I am using powerbuilder 7.0 with oracle 8I I have my datatype in oracle as number 21,3 The problem is as soon as my itemchaged event fires its chages the value inputted to exponentation . Also as soon as i convert it into string it turns into expoentation is the value to large to convert it into string will i have to use asn external dw please let me know a way out Thanks Nimmay Decimal only has 18 digits of precision. Sounds like PB is using Double to at least store the magnitude, but that cuts you down to 15 digits. Does that column really have to be that big? ...

inserting a decimal number from.net to stored proc. with decimal parameter
I'm trying to enter large number 99999999, (8 digits) converting to decimal in .NET, then using that as a parameter in stored proc. which has a decimal type (decimal(15,2) as a parameter. C#:if (txtAnnualizedSaving.Text.Trim() != string.Empty) {try { sdata.AnnualizedSaving = Convert.ToDecimal(txtAnnualizedSaving.Text); // only for testing ....scale = (System.Decimal.GetBits(sdata.AnnualizedSaving)[3] >> 16) & 31; }catch { sdata.AnnualizedSaving = 0; } }   ... In the business object I have the following code:private bool UpdateData() {bool ret = false; try ...

Net:Net:Net::LDAP::FAQ
------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

Net::MySQL hangs
Strange problem. I can get the example program to work with MySQL but I can't get it to work with my other table. In hpux where would i find the error messages generated by this? Here is the code $ cat dnssel.pl #!/usr/bin/perl # a test of querying the dnstable on database dev use strict; use Net::MySQL; my $mysql = Net::MySQL->new( hostname => 'localhost', database => 'dev', user => 'dev', password => 'passwrd', ); # now setup query into database print " befo...

Decimal datatype problem
Hi I am having some problems with the Decimal datatype in SQL 2005. I am using Visual Web Developer 2008 Express edition to develop a website that stores a value in a decimal column in a MSSQL 2005 database. I use the following command to store the value:Dim db As New TestDatabaseDataContextDim NewEntry As New TestTable NewEntry.TestDecimal= "52.123532" db.TestTable.InsertOnSubmit(NewEntry) db.SubmitChanges() When I then check the record in the database, it says 52.000000. What happened to the other 6 numbers on the right side? Check that the InsertOnSubmit code defines&nb...

New to MySQL with .net
I have usually only work with mssql for but for this project I am using mysql.  After doing some reading it seems one of the best ways to connect to mysql is throught the MySQL Connector/Net.  I have downloaded and installed this and for the most part it is working.  I can connect to the database and pull simple select statements.  I am now trying to write data and I get an error.  The error is:MySql.Data.MySqlClient.MySqlException: Parameter '@value1' not found in collectionPlease see the code below for how I am trying to insert data into the database.  Th...

Web resources about - Decimal Datatype - asp.net.mysql

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: 1/2/2016 9:45:28 AM