CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 10/5/2005 2:07:32 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 29 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
eltonho
Asp.Net User
TextBox to variable10/5/2005 2:07:32 PM

0/0

Hi all,

I have the following questions regarding to the captioned. See if anyone can help.

Q1. 

2 textbox fields : 1 will be input date as ShortDateFormat; another will be input as time HH:mm.  How can I derive a DateTime variable form these 2 fields. I have tried this: DateTime.ParseExact (TB1.Text + " " + TB2.Text, "d HH:mm", CultureInfo.InvariantCulture) not it does not work.

Q2.

1 textbox field to be input a decimal amount. And I have tried this : myDec = decimal.Parse(TB1.Text). It does not work if the field contains nothing. So, it means I have to check whether the field is empty before I use Parse. Right?


Thanks,
Elton

ndinakar
Asp.Net User
Re: TextBox to variable10/5/2005 3:55:09 PM

0/0

For Q1 its more of a trial and error thing with concatenations.
For Q2, yes you would need to check if the textbox is empty before attempting to covnert the value in it to decimal.
***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
chadgei
Asp.Net User
Re: TextBox to variable10/7/2005 2:08:03 PM

0/0

I noticed that you asked a similar question in this same forum - I am hoping this will answer both questions.

You may also want to take a look at the DateTime.TryParse and Decimal.TryParse methods.  First, you will probably want to put a RequiredFieldValidator on your textboxes to guard against any empty input (you should still check in the code, but the TryParse methods may be all you need at that point).  The TryParse methods won't throw an exception if they can't parse the input string.  Each method returns true if it was successful, false if not.  Here are the links to the docs on MSDN.

DateTime.TryParse:
http://msdn2.microsoft.com/en-us/library/wteydsd6

Decimal.TryParse:
http://msdn2.microsoft.com/en-us/library/s3b1e5ha(en-US,VS.80).aspx

Hope that helps!

  --  chad

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Building Applications and Components with Visual Basic .NET Authors: Ted Pattison, Joe Hummel, Pages: 562, Published: 2003
Macromedia Flash MX for Windows and Macintosh: Visual QuickStart Guide Authors: Katherine Ulrich, Pages: 613, Published: 2002
Flash 5 Hands-on Training: Hands-on Training Authors: Kymberlee Weil, Garo Green, Lynda Weinman, Pages: 739, Published: 2002
Beginning Access 2003 VBA Authors: Denise Gosnell, Pages: 552, Published: 2004
Data Analysis Using SPSS for Windows: A Beginner's Guide Authors: Jeremy J. Foster, Pages: 224, Published: 1998
Special Edition Using WordPerfect Office X3 Authors: Laura Acklen, Read Gilgen, Pages: 979, Published: 2006
Schaum's Outline of Introduction to Computer Science: With Examples in C, C++, and Java Authors: Ramon A. Mata-Toledo, Pauline K. Cushman, Pages: 240, Published: 2000
PHP5 and MySQL Bible Authors: Tim Converse, Joyce Park, Clark Morgan, Pages: 1042, Published: 2004
How to Do Everything with Macromedia Flash MX 2004 Authors: Bonnie Blake, Doug Sahlin, Pages: 512, Published: 2003

Web:
VB.NET - Assign Textbox To Variable | DreamInCode.net NET - Assign Textbox To Variable. Get help with this and thousands of other VB. NET programming topics at DreamInCode.net.
Dynamically assign textbox ID to a textbox variable in a loop ... Dynamically assign textbox ID to a textbox variable in a loop?. Get answers to your questions in our .NET ASP forum.
Access text box using variable Talk about Access text box using variable. ... 11-30-2005, 11:22 AM. Eliyahu Goldin. Posts: n/a. Default Re: Access text box using variable ...
text box as variable - CodingForums.com text box as variable JavaScript programming. ... How can I use a textbox (ex. < input type=text>) as a variable. Like in the place of a prompt in var ...
Pass Date In TextBox To Variable - Excel Help Best Practice Forums Jun 8, 2008 ... Pass Date In TextBox To Variable EXCEL HELP. ... How to pass a date in a TextBox to a variable. ADS BY OZGRID. ...
Flash Dynamic text box and variable question.. - kirupaForum Flash Dynamic text box and variable question.. Flash MX 2004 (and Earlier)
Autofill textbox w/ variable - ASP.NET Forums Autofill textbox w/ variable. Last post 09-11-2006 10:31 AM by provenir. 32 replies. ... I need to autofill a text box with a variable. ...
Assign value from userorm textbox to variable? - MrExcel Message Board Assign value from userorm textbox to variable? Excel Questions.
Visual Basic - Specify Textbox For Variable Output | DreamInCode.net Visual Basic - Specify Textbox For Variable Output. Get help with this and thousands of other programming and web development topics at DreamInCode.net.
PHP Variable to prefill text box : PHP I want to be able to take a textbox and prefill it with the variable from mysql query. I want to use the variable from this section; and prefill a textbox ...

Videos:
LEARN VB.NET 2008 L2 TRICKS WITH MES BOXES & VARIABLE TEXT Gymjunnky.com Welcome's you to learn VB.NET 2005/2008 this is tutorial no2 and my name is Gym_ In this short tutorial I'm going to demonstrate popup...
How to VB: Variables, TextBoxes, and Radio Buttons how to use Variables, textboxes, and radiobuttons together in visual basic.... note- i am using visual basic 2008 Express
Ubernoob vb6 tutorial video This is more of a first program sort of tutorial. It uses a button, textbox, and label, and greets the user with a messagebox, demonstrating the use ...
how to make a flash trainer with vb2008 vb2008 http://www.microsoft.com/Express/VB/ the variable finder http://www.top-design.ro/r4zcheater/download.php and wat i typed in Call Flash.SetVa...




Search This Site:










restore my sql database help!

signin page - add additional field for password reminder

upload directory - lack of folders

simple windows authentication

css friendly control adapters is not running with update panel of atlas

dnn install/upgrade problem

allow unsafe in vs 2005

save file

title in pages

can't map asp.net roles to windows groups

using existing sql server db with new asp.net 2.0 application with login

provider design pattern and spec for asp.net 1.1

invalid folder name for module. cannot delete module.

dotnetnuke.moduleloadexception: unhandled error loading module

how to expand a treenode

debug

feature suggestion

dynamically added user control disapearing on postback

dropdownlist will not work in content page

is there an interest in a list serv type of module for dnn?

is "write a new post" a webparts interface?

postback and controls rendering

sql server 2005 - remote connections error - named pipes : tcp

problem with security tab - there is a problem with your selected data store...

max nodes in a treeview.

get a control from master page

tabbed windows

having problem display css using import

cdottext module release!

ping times problem

 
All Times Are GMT