473,378 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

multi methods

is it possible that one class has multi methods and each method return a value ? because while I am trying to create a class with two methods each one return bool value I got the error

Error 24 'WiPosGUICSharp.sqldatabase.export(System.Collecti ons.Generic.List<string>)': not all code paths return a value D:\master\WIPos\graphic\GUI\WiPosGUICSharp\sqldata base.cs 103 23 WiPosGUICSharp
Feb 17 '09 #1
1 1225
tlhintoq
3,525 Expert 2GB
Yes! Absolutly it is possible that a class has more than one method that returns a value. I would expect that description fits more classes than not.

A 'person' class might have a method for GetAge(), another for GetWeight() another for GetBirthday, etc.

As for your error of "not all paths return a value"... You've just missed someplace where the method is supposed to return a value/answer/calculation to the method that called it. For example: Maybe you only return a value inside an "if" construct, but not outside of it. If the "if" condition is never true then you never return a value. Or maybe inside the "try" block, but not inside the "catch" block, so once again there is a possible scenario where no value is returned.

Try placing a breakpoint at the beginning of the method and walking through it step by step.

If all else fails, post the method back in this thread and maybe a fresh set of eyes can see it.
Feb 17 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Atul Kshirsagar | last post by:
I am embedding python in my C++ application. I am using Python *2.3.2* with a C++ extention DLL in multi-threaded environment. I am using SWIG-1.3.19 to generate C++ to Python interface. Now to...
1
by: Stephen Thorne | last post by:
Decorators have been getting lots of air-time at the moment, but only really the syntax. After a short discussion on irc the other night I decided to download python2.4 from experimental and write...
5
by: hari | last post by:
HI, I am trying multi threading in asp.net , but i could not do it. We do a daily Run in our company for calculations purpose etc.. we use SQl Stored Procedures to do all the process at back end....
0
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black...
3
by: Eivind Grimsby Haarr | last post by:
I would really like to have multiple dispatch in C++, and I have been reading the multimethods proposal at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1529.html (And the paragraph in...
3
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which...
27
by: Bernard Bourée | last post by:
Is there a way to overpass the impossibility of VN.NET to accept the multi heritage, that is to allow a class to inherit from TWO mother classes ? -- Bernard Bourée bernard@bouree.net
23
by: Kaz Kylheku | last post by:
I've been reading the recent cross-posted flamewar, and read Guido's article where he posits that embedding multi-line lambdas in expressions is an unsolvable puzzle. So for the last 15 minutes...
3
by: Fred | last post by:
We all agree that multi-core is where the industry is headed. Can the .NET framework take advantage of multi-cores? are the programs written in .NET multi-threaded by default or is additional...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.