Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cannot implicitly convert type 'double' to 'string' (textbox.Text *= 1.25;)

Posted on 2004-09-30
3
Medium Priority
?
3,730 Views
Last Modified: 2008-08-02
In VB.NET you can write textBox.Text *= 1.25, but in C# I got this error:
Cannot implicitly convert type 'double' to 'string'

How do you multiply a textbox value with something?
0
Comment
Question by:MimerQ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:dttri
ID: 12197219
 Hello,
  To convert between for example string and double, you can use these member functions of Double class:

    public static double Parse(string)
    public override string ToString()

  Tri
0
 
LVL 6

Accepted Solution

by:
viola123 earned 150 total points
ID: 12197314
private void getValue()
{
     double aa;
     aa = double.parse(this.textBox.text) * 1.25;
     this.textBox.text = aa.ToString();
     
}
0
 

Expert Comment

by:looknow12
ID: 22143946
That one was silly, I fixed it with this.

eTotal.Text = Convert.ToString(Convert.ToDouble(Convert.ToDecimal(eKWUsage.ToString()) + Convert.ToDecimal(eRate.ToString())));

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question