Welcome to Dream.In.Code
Become an Expert!

Join 150,193 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,036 people online right now. Registration is fast and FREE... Join Now!




Error in calculating irr in asp.net using vb.net

 
Reply to this topicStart new topic

Error in calculating irr in asp.net using vb.net

asmasm
15 Sep, 2008 - 04:47 AM
Post #1

New D.I.C Head
*

Joined: 11 Sep, 2008
Posts: 2

i am calculating irr and pass listarray created at runtime to irr function and i get error. as i'm new to .net
i have to calculate irr
textbox2.text specify the no installments
textbox1.text specify loan amount
textbox5.text specify the amount of installments
Dim i As Int16
Dim pay As New ArrayList()
For i = 0 To TextBox2.Text
pay.Add(TextBox5.Text)
Next
pay.Add(-TextBox1.Text)
Dim ir As Double
ir = Math.Round(Microsoft.VisualBasic.Financial.IRR(pay (TextBox2.Text + 1), 0.1), 2)
TextBox7.Text = ir
GET THIS ERROR MESSAGE
Unable to cast object of type 'System.Double' to type 'System.Double[]'.

User is offlineProfile CardPM
+Quote Post

dineeshd
RE: Error In Calculating Irr In Asp.net Using Vb.net
15 Sep, 2008 - 05:06 AM
Post #2

D.I.C Addict
Group Icon

Joined: 30 Jun, 2008
Posts: 579



Thanked: 16 times
Dream Kudos: 575
My Contributions
If I am not wrong below code is giving error. right?

vb
ir = Math.Round(Microsoft.VisualBasic.Financial.IRR(pay (TextBox2.Text + 1), 0.1), 2)

You are trying to assign pay, which is Double Array type to irr which is Double type. So it must give error. You need to reconstruct your logic. May be you need to make a sum of pay values and assign it to irr.

And please use Code Tags while posting code.
Example: code.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 04:20AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month