| | |
Badly Stuck
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2008
Posts: 126
Reputation:
Solved Threads: 1
pl.help me out on this :
i need to calculate balance amount....however...i am not able to calculate it.
C i have coursefees
then when i click on installment 1 and enter the amount my balance amount textbox should reflect
the coursefees- installment1 total
similarly when i click on installment 2 and enter the amount my balance amt textbox should reflect
the coursefees-inst1-inst2 value
similarly when i click on intallment 3 and enter the amount my balance amt textbox should reflect
the coursefees -inst1-inst2-inst3
however i am getting error as cannot convert string "" to double...! i tired a lot but i am not
getting over this error ! Pl help me out soon !
waiting for quick response!
2) can ne one tell me how to validate email id text box....
eg..if @ sign is missing it should prompt(Invalid email id!)
cya
Rohan
i need to calculate balance amount....however...i am not able to calculate it.
C i have coursefees
then when i click on installment 1 and enter the amount my balance amount textbox should reflect
the coursefees- installment1 total
similarly when i click on installment 2 and enter the amount my balance amt textbox should reflect
the coursefees-inst1-inst2 value
similarly when i click on intallment 3 and enter the amount my balance amt textbox should reflect
the coursefees -inst1-inst2-inst3
however i am getting error as cannot convert string "" to double...! i tired a lot but i am not
getting over this error ! Pl help me out soon !
waiting for quick response!
2) can ne one tell me how to validate email id text box....
eg..if @ sign is missing it should prompt(Invalid email id!)
cya
Rohan
it would be better if you post your code
any way , I think you didn't convert from string to double before calculating,
you wrote like this
it may work but if user did not enter value and leave the textbox empty then you will have cannot convert string "" to double error
to solve it
I hope this will help you
any way , I think you didn't convert from string to double before calculating,
you wrote like this
VB.NET Syntax (Toggle Plain Text)
Balance.Text = coursefees - installment1.Text
to solve it
VB.NET Syntax (Toggle Plain Text)
Balance.Text = coursefees - CDbl(installment1.Text)
Last edited by manal; Sep 30th, 2008 at 11:48 am.
"give only what u willing to receive "
The problem you are having concerning "cannot convert string "" to double" is that you have an empty textbox. You need to add code so that if a textbox is blank, then the program does not try to perform a calculation on it. Better yet, add some validation to make sure the text is a number.
For item number two, use the instr() command to see if the "@" character is in the e-mail address. i.e.
For item number two, use the instr() command to see if the "@" character is in the e-mail address. i.e.
vb Syntax (Toggle Plain Text)
If InStr(emailID,"@") > 0 then emailIDOkay = TRUE else emailIDOkay = False End If
Here's a link to test for a valid email address with regular expression:
http://www.vbforums.com/showthread.php?t=407441
and you should also check:
http://www.regular-expressions.info/email.html
and you'll notice that there's not any bullet-proof method to test email address validity.
Manal answered your first question, but here's a slightly improved version:
http://www.vbforums.com/showthread.php?t=407441
and you should also check:
http://www.regular-expressions.info/email.html
and you'll notice that there's not any bullet-proof method to test email address validity.
Manal answered your first question, but here's a slightly improved version:
VB.NET Syntax (Toggle Plain Text)
If String.IsNullOrEmpty(installment1.Text) Then ' Empty value Balance.Text = "" Else Try Balance.Text = (coursefees - CDbl(installment1.Text)).ToString Catch ex As Exception ' installment1.Text was not a numerical value Balance.Text = "" End Try End If
Teme64 @ Windows Developer Blog
•
•
Join Date: Aug 2008
Posts: 126
Reputation:
Solved Threads: 1
Oh thanks a lot for your favourable responses !!! I will surely try ur codes....Thanks a lot once again....!
cya
Rohan
cya
Rohan
•
•
•
•
Here's a link to test for a valid email address with regular expression:
http://www.vbforums.com/showthread.php?t=407441
and you should also check:
http://www.regular-expressions.info/email.html
and you'll notice that there's not any bullet-proof method to test email address validity.
Manal answered your first question, but here's a slightly improved version:
VB.NET Syntax (Toggle Plain Text)
If String.IsNullOrEmpty(installment1.Text) Then ' Empty value Balance.Text = "" Else Try Balance.Text = (coursefees - CDbl(installment1.Text)).ToString Catch ex As Exception ' installment1.Text was not a numerical value Balance.Text = "" End Try End If
![]() |
Similar Threads
- stuck on xp welcome screen (Troubleshooting Dead Machines)
- Gas Pedal Stuck To The Floor! (Windows NT / 2000 / XP)
- Stuck on school assignment (Pascal and Delphi)
- Adsense error in html (Site Layout and Usability)
- Help (IT Professionals' Lounge)
- Java tutor needed BADLY (Java)
- Need help badly (Troubleshooting Dead Machines)
Other Threads in the VB.NET Forum
- Previous Thread: Help usign explorer form...
- Next Thread: [B]setup[/B]
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access arithmetic array assignment basic binary bing box button buttons center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist excel file-dialog firewall folder ftp google hardcopy image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend navigate net networking opacity output peertopeervideostreaming picturebox picturebox1 plugin port print problemwithinstallation project record reports" save savedialog searchbox serial server soap sorting sql string tcp temp text textbox timer toolbox trim updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





