Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 8th, 2004, 10:37 AM
Authorized User
Join Date: Feb 2004
Location: Philadelphia, , USA.
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.



  #2 (permalink)  
Old April 8th, 2004, 08:16 PM
Authorized User
Join Date: Apr 2004
Location: Nanjing, Jiangsu, China.
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?


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 05:40 PM.

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