Results 1 to 4 of 4

Thread: Cannot convert type 'string' to 'double'

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    10

    Cannot convert type 'string' to 'double'

    hello friends leave east error to me, know as I can solve it?

    Cannot convert type 'string' to 'double'

    Thanks

    Ronald Saavedra

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Cannot convert type 'string' to 'double'

    You have to parse the string into a double using the Double.Parse(), or Double.TryParse() methods.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Cannot convert type 'string' to 'double'

    Also the Convert.ToDouble(MyString) should do the trick.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Cannot convert type 'string' to 'double'

    From the help topic for Convert.ToDouble(String):
    Remarks
    The return value is the result of invoking the Double.Parse method on value.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width