I need to check if a variable I have is of the data type double. This is what I tried:
double
try { double price = Convert.ToDouble(txtPrice.Text); } c
Couldn't you just use:
double.Parse(txtPrice.Text);
?
With this you will a FormatException saying "Input string was not in a correct format." if the string value isn't a double, which looks to be roughly what you were doing manually anyway.