C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Windows »

How to convert object array value to double array in vb.net?


Posted Date: 03 Nov 2009      Posted By: Lakshmi      Member Level: Gold     Points: 1   Responses: 1



Hi friends,

I need to convert the object array value to the double array value in vb.net?

Following is my code:

dim s() as object
dim ss as string
ss="5.6,7.8,6.7"
s=split(s,",")
dim d() as doube

Now i have to convert the object Array ( s ) to Double array (d).

How to convert this?

When trying this , i get the following error:

Value of type '1-dimensional array of object' cannot be converted to '1-dimensional array of double' because 'object' is not derived from 'double'

Thanks in Advance





Responses

Author: Neetu    03 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi dear.
Try this code.

Sub Main()
Dim s() As Object
Dim ss As String
ss = "5.6,7.8,6.7"
s = ss.Split(",")
Dim d(s.Length - 1) As Double
' d = CType(s, Double())
Dim a As Object
Dim i As Integer
i = 0
For Each a In s
d(i) = CDbl(a)
i = i + 1
Next


Dim d1 As Double
For Each d1 In d
System.Console.WriteLine(d1)
Next
End Sub

regards
Neetu



Post Reply
You must Sign In to post a response.
Next : Created setup is not able to install
Previous : How to draw chart in crystal report in vb.net?
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use