| | |
Badly Stuck
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
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]
Views: 527 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access add advanced application array basic beginner browser button buttons center class click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker design designer dissertation dissertations dissertationtopic eclipse employees excel exists forms function html images lib listview map mobile module msaccess mysql net number open page pan pdf picturebox picturebox2 port position print printing printpreview problem refresh regex reuse richtextbox right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure studio textbox timer timespan transparency txttoxmlconverter usercontol vb vb.net vb2008 vba vbnet vista visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winsock wpf wrapingcode xml year





