public static int insert_value(string image_name,string image_path,string image_upload_time,string image_upload_date,string status) [英] public static int insert_value(string image_name, string image_path, string image_upload_time, string image_upload_date, string status)

查看:115
本文介绍了public static int insert_value(string image_name,string image_path,string image_upload_time,string image_upload_date,string status)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它的代表错误

并非所有代码路径都返回一个值

its representing error
not all code path returns a value

推荐答案

1.这个错误是由一些事实产生的你的方法branch / path没有返回intExpression; ,例如你错过了将return表达式添加到else分支或其他东西。



2.为了能给你更多的帮助你必须在上面的原始问题中发布你的方法!
1.This error is generated, by the fact that some of your method branch/path do not have return intExpression; on it, for example you missed to add return expression into an else branch or something.

2.In order to can give you more help you have to publish your method in your original question above!


它被声明为一个返回整数的方法value - 但是编译器可以看到通过该方法的路径,其中没有返回任何值,并且不会抛出任何异常。

这将意味着在运行时出现问题,因此编译失败。

正常原因是在最后忘记了 return x; ,或者错过了返回的值声明完全;或者打算让方法根本不返回值。在后一种情况下,将定义更改为:

It's declared as a method returning an integer value - but the compiler can see a path through the method where no value is returned, and no exception is thrown.
This would mean a problem at run time, so the compilation fails.
The normal reason for this to forget the "return x;" at the very end, or to miss out the value with a return statement completely; or to have intended the method to not return a value at all. In the later case change the definition to:
public static void insert_value(...





有一个好好看看代码 - 它应该是相当明显的。



请尽量遵循C#命名约定,不包括下划线:应该调用该方法 InsertValue ,而非 insert_value


这篇关于public static int insert_value(string image_name,string image_path,string image_upload_time,string image_upload_date,string status)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆