Discussion Locked

CONVERT FROM TEXT TO DOUBLE IN VB.NET

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm working on a class project (VB.Net 2003). I'm trying to program my Calculate button, and in so doing I have to convert a field value from text to number (double). Here's what I have so far:

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim pdblLength As Double
Dim pdblWidth As Double
Dim pdblHeight As Double
Dim pdblVolumeTotal As Double
txtLength = System.Convert.ToDouble

Please help!!!

Thanks,

4 replies

by amolj

try following soln
dblLength = cType(txtLength,Double)

/*dblLength variable gets numeric value*/

This discussion is closed to new replies.