if (dr.Read() == true)
{
textBox2.Text= dr.GetSqlValue(0).ToString();
}
i am try like this string value to double but i got error.......
label5.Text = Convert.ToDouble(textBox2.Text);
please give me ans
how to convert string value to double......
Here how to convert string to double ..
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Oct 14, 2012, 5:48 AM EDT
label5.Text = textBox2.Text;
Incidentally, to convert what's in the textbox to a double in a fool-proof way. I'd use:
double d;
bool isValid = Double.TryParse(textBox2.Text, out d);
if (!isValid)
{
MessageBox.Show("Not a valid number. Please amend");
textBox2.Focus();
return;
}
// do something with 'd'
sri40 reputationPosted Oct 14, 2012, 6:38 AM EDT
the string value can't be stored in the table..
VulpesRank #55 · 29.2K reputationPosted Oct 14, 2012, 6:41 AM EDT
sri40 reputationPosted Oct 14, 2012, 7:39 AM EDT
it is working......