I am trying to return a result from one of my methods but i keep getting an error message "not all code paths return a value".
I would appreciate if somebody could take a look at my code and advise where I am going wrong please?
DoComparsion method returns true or false;
I am just trying to test a method i have written:
private bool Comparison(Bitmap bitmap)
{
bool result;
foreach (DataGridViewRow dgrow in dataGridView1.Rows)
{
if (!dgrow.IsNewRow)
{
String fullPath = dgrow.Cells[1].Value.ToString();
try
{
if (File.Exists(fullPath))
{
Bitmap servBitmap = new Bitmap(fullPath);
result= DoComparison(bitmap, servBitmap);
return result;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace.ToString());
}
}
Thanks in advance.

New Topic/Question
Reply




MultiQuote






|