473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Class for storing fixed width strings including validation

Hi Group,

Are there any examples of class for storing fixed width number strings
such as phone number and social security numbers.

This class would do thing like valid that the number is all integers
or hex and confirm that the number is the correct length. I

f the number is to short return an error or not store the number, etc.

I have a lot of fixed width number string I need to store.

At the moment each string I valid date the ranges etc in each section.

It would be nice to have a class that handles all this for me.

Any suggestion on finding one.

Thanks

Mark
Nov 16 '05 #1
1 1612
Sorry, the class you are looking for doesn't exist. As of Whidbey WinForms
and ASP .NET both support a masked edit box I believe (I know WinForms
does), so you can validate the input in that manner before it ever gets into
your
collections.

You are look for a fairly specialized tool here. You need to specify a minimum
length, some sort of format string, and you need some sort of error reporting
and
feedback. This isn't normally the type of classes that are implemented in the
BCL
because of the many different ways they could be implemented, considerations
for performance of a generic versus specialized method, and the relatively small
amount of code required to implement this yourself.

If you need help come back and let us know, perhaps with some sample source
code of your attempt.

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Mark Smith" <sh******@yahoo.com.au> wrote in message
news:8b**************************@posting.google.c om...
Hi Group,

Are there any examples of class for storing fixed width number strings
such as phone number and social security numbers.

This class would do thing like valid that the number is all integers
or hex and confirm that the number is the correct length. I

f the number is to short return an error or not store the number, etc.

I have a lot of fixed width number string I need to store.

At the moment each string I valid date the ranges etc in each section.

It would be nice to have a class that handles all this for me.

Any suggestion on finding one.

Thanks

Mark

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Adrian Parker | last post by:
I'm using the code below in my project. When I print all of these fixed length string variables, one per line, they strings in questions do not properly pad with 0s. strQuantity prints as " ...
4
by: Hal Vaughan | last post by:
I want to have a config file for my program, which means I need to know where the config file is. If I type: java myclass and it runs myclass.class, is there any way to obtain the location of...
1
by: Christopher | last post by:
Hi all, I am trying to store a reference to a variable in my data providerr class but cannot save a reference to it. Can anyone help me? I would like this code to allow me to store any field...
0
by: TJ Talluto | last post by:
<facts> I have a "month calendar" that always displays exactly 42 days... and alongside is a vertical box that displays the detail (form fields) of any particular select event that appears on the...
28
by: Gabriel | last post by:
greetings, I want to achieve the following effect : Menu1 | Menu2 | Menu3 | Menu4 | Menu5 | I played with padding, border-width and the like and it's ok for the | . My problem is that...
7
by: Ben Amada | last post by:
I've created a class that I need to store in ViewState. However when I try to store it in ViewState, I get the following error: "The type 'solution.pe2' must be marked as Serializable or have a...
4
by: BostonNole | last post by:
I am looking for suggestions on the most efficient way to import 7 different fixed width files into a DataSet. Not all at the same time. One file at a time, but the format could change from file...
5
by: toton | last post by:
Hi, I have a deque of Point class,. Point class have two fields x, and y. Now I want another class Character should point to a portion of the deque, and allow iteration only on the portion. Thus...
10
by: BostonNole | last post by:
Using Visual Studio 2005, .NET 2.0 and VB.NET: I am looking for the fastest possible way to import a very large fixed width file (over 6 million records and over 1.2 GB file size) into a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.