473,545 Members | 721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parsing content from textboxes efficiently

taa
Hi there
I’m trying to come up with a smart way of parsing content from
textboxes in C#. I have about 7-10 boxes with different content;
dates, times, numbers and text that has to be parsed and inserted into
my database.
Of course the obvious solution is to make a lot of if’s and parse each
box one at the time with the properties I know and catch all
exceptions on the way, if any, but does anyone has an idea of a
smarter way of doing this?
Thought about making a list of the boxes with content, so I don’t have
to waste time parsing the empty ones and catching exceptions.

An example of how I'm parsing a Textbox containing a date:
if (BeginTime.Text != "__:__:__")
{
ad.DateTimeBegi n = DateTime.ParseE xact(BeginDate. Text,

CultureInfo.Cur rentCulture.Dat eTimeFormat.Sho rtDatePattern,
null);
}
Regards
Lasse
Jul 24 '08 #1
0 1173

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

Similar topics

3
2230
by: Fuzzyman | last post by:
I want to parse some text and generate an output that is similar but not identical to the input. The string I produce will be of similar length to the input string - but a bit longer. I'm parsing character by character and adding the characters of the input string to the output until I come to ones I want to modify. This means creating a...
0
1543
by: Naren | last post by:
I have an XML like the one below. I am using SAX parsing and I need to get the information between the tags of the Email element. First i try to access the content and print it out and it gives me weird results. XML: /www.xmlspy.com) by AB(Co) --><!--Sample XML file generated by XML Spy v4.0.1 U (http://www.xmlspy.com)--> <RoomResRQ...
3
3054
by: Girish | last post by:
Hi All, I have written a component(ATL COM) that wraps Xerces C++ parser. I am firing necessary events for each of the notifications that I have handled for the Content and Error handler. The events can then I am able to parse XML input in the form of files. I also have provided support for parsing of XML content in the form of string...
4
5246
by: Earl | last post by:
I'm curious if there are others who have a better method of accepting/parsing phone numbers. I've used a couple of different techniques that are functional but I can't really say that I'm totally happy with either. 1. My first technique was to restrict the users to entries that could only be 3 character, 3 characters, 4 character (area...
5
5227
by: PulsarSL | last post by:
Hey everyone, What function can I use to grab a .csv file from a remote webserver for use in my PHP script. I want to do some parsing and statistical analysis on it (server side). What PHP function is used for this? I can't seem to find it in Google or the online PHP manual, because I don't really know what keywords to use.
1
2418
by: yonido | last post by:
hello, my goal is to get patterns out of email files - say "message forwarding" patterns (message forwarded from: xx to: yy subject: zz) now lets say there are tons of these patterns (by gmail, outlook, etc) - and i want to create some rules of how to get them out of the mail's html body. so at first i tried using regular expressions:...
9
4046
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics" portions of Babe Ruth page (http://www.baseballprospectus.com/dt/ruthba01.shtml) and store that info in a CSV file. Also, I would like to do this for...
8
1194
by: Randy | last post by:
I have a form with 36 text boxes on it. I have everything working for the user to make changes to existing records or to add new ones. When I come to the point of passing this data on to the data source, I'm looking for an efficient way to do this. The only way that I know of is a line-by-line procedure that passes each textbox to the...
0
1164
by: justAskin | last post by:
I'm wondering how to get the content of a textbox or richtextbox control in ANOTHER process , given its handle. I have made a program which seems to able to get the content from simpler programs, like the textfield of notepad.exe and such, but when I try other applications it doesnt work. The way I'm currently getting the content is using...
0
7465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5325
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.