Overload resolution failed on Math.Ceiling

I have the following error:

Overload resolution failed because no accessible 'Ceiling' can be called without a narrowing conversion.

My code is:

dgiOpr01Rep.Cells(7).Text = AddPrecZero(Math.Ceiling(dtgCollections.Items(i).Cells(7).Text))

Can someone help me?

Answers


Basically the compiler is saying that it can't choose which overload to use without further information

Try converting the text value to a numeric type first, for example:

Dim val As Decimal = Decimal.Parse(dtgCollections.Items(i).Cells(7).Text)
dgiOpr01Rep.Cells(7).Text = AddPrecZero(Math.Ceiling(val))

You need to use whatever numeric type matches the contents of the text though.


Need Your Help

Grabbing the posts from all the users that I am following

php while-loop user posts

So I made a following system and that is obviously based around the users that exist in my "users" table. I just a made a posts system where users can post things. I am trying to make a feed where ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.