Results 1 to 3 of 3

Thread: Compile Problem.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    66

    Compile Problem.

    HI i get this error

    Error 33 The call is ambiguous between the following methods or properties: 'System.Math.Ceiling(decimal)' and 'System.Math.Ceiling(double)' C:\Documents and Settings\B\Desktop\Lewies_Min177620812004\MiniHexEdit\Form1.cs 491 22 MiniHexEdit
    On this line:

    Code:
    int items = (int)System.Math.Ceiling((listView1.Height - headerFooter) / itemHeight);
    Any ideas?

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

    Re: Compile Problem.

    It means your code could be considered a decimal or a double and you have to tell it what. You could just use the Convert.ToDecimal or Convert.ToDouble (or just a Double.Parse()).
    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

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

    Re: Compile Problem.

    What type does the expression you are passing to Math.Ceiling return? You can find out by placing a breakpoint on that line and pasting that expression into the Watch window. Presumably it is not returning either a Double or Decimal, so it needs to be converted to one of those types because they are the only types that Math.Ceiling accepts. Computers can't "guess" which way to go. If there are two equally likely possibilites a computer just says "don't know, give up". Basically, you have to tell it whether it is dealing with a Double or a Decimal.
    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