Hi @Chetan Sharma ,
Conversion from string to type Double is not valid
As the error says, maybe you can try Double.TryParse
, which is a safe way to convert values to doubles. If the conversion is successful, the method returns true and returns the result double in the out parameter. If the conversion fails, returns false and returns the default value of double (that is, 0).
https://learn.microsoft.com/en-us/dotnet/api/system.double.tryparse?view=net-6.0
A simple example:
Dim result As Double
Dim score As String = "75"
If Double.TryParse(score, result) Then
' result will be a double with the value of 75'
Else
' The conversion attempt failed, and result will have a value of 0'
End If
Maybe you can provide detailed code so we can help you better.
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.