Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 8th, 2004, 10:37 AM
Authorized User
Join Date: Feb 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting user input - SmallMoney type

Hi, all.

I have a slight problem with a data field & need some help on converting data types. I have looked around & cannot find a good, clear explanation of passing data from ASP pages to SQL databases.

Here's what I have:
1. a field in a table called 'CertFees' which is type SmallMoney.
2. a Sproc that passing the value along from the ASP page through the statement '@CertFees SmallMoney'.
3. an ASP page that displays the data in a textbox with the follwing code:
<asp:TextBox id="tbxCertFees" Text='<%# DataBinder.Eval Container.DataItem, "CertFees", "{0:C}") %>' runat="server" />
4. a SQL command of:
Dim objUpParameter19 As New SqlParameter("@CertFees", SqlDbType.SmallMoney)
that sends the data to the Sproc.

The data displays nicely with the format $##.##. & if the user enters a number in decimal format, such as 25.50 or 9, there's no problem. However, it breaks down when the user enters a '$' or any other character info. I know I need to convert the enter data to a SmallMoney type before sending the data to the database, but I'm not sure how.

Any pointers? & if you know of a good source to read about types & SQL/ASP, that would help a lot.



Old April 8th, 2004, 08:16 PM
Authorized User
Join Date: Apr 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Mohammed

use regular expression to restrict user's input?

Similar Threads
Thread Thread Starter Forum Replies Last Post
User-defined type as input for store procedures davidb BOOK: Professional Java Development with the Spring Framework 0 August 11th, 2005 02:49 PM
conert smallmoney data type into string zouky Crystal Reports 0 October 20th, 2004 09:43 PM
Any One Help me Type Converting yoord BOOK: Beginning ASP.NET 1.0 0 September 21st, 2004 04:17 AM
<input type="File"> - Specify File Type and Path gp_mk Classic ASP Basics 2 August 2nd, 2004 03:07 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.