请查找导致此错误的原因 [英] please find cause fro this error

查看:77
本文介绍了请查找导致此错误的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CreateCompanyProfile(txtcompanyname.Text, imgBinaryData, txtcompanytagline.Text, txtcompanyprof.Text, companyestd, companyempcount, txttype.Text, txttelephone.Text, txtemail.Text, txtfax.Text, txtaddress.Text,txturl.Text,txtmanagername.Text,txtmanagerdesign.Text,txtmanagerprofile.Text,  txtclients.Text, txthrname.Text, txthrdesign.Text, txthremail.Text);



我将此方法称为



i am calling this method as

public void CreateCompanyProfile( string ComName, byte[] imgbin, string ComTagLine, string ComProfile, int ComEstd, int ComEmpCount, string ComType, string ComTelephone, string ComEmail, string ComFax, string ComAddress, string ComURL, string strmangername, string strmanagerdesign, string strmanagerprof, string ComClients, string CreaterName, string CreaterDesig, string CreaterMailID )


这时iam得到1 error :member names cannot be the same as their enclosing type c#
请帮助我,导致此错误的原因是什么?


at this time iam getting 1 error :member names cannot be the same as their enclosing type c#
please help me ,what is the cause of this error?

推荐答案

类名和方法名可能看起来相同.您的方法...
The class name and the Method name might be same it seems..If so means change the name of your method...


我猜您的方法名称与类名称相同.是吗?

如果是,则它是错误的.编译器假定该方法为构造函数,并且由于它具有返回类型,因此会引发错误
I guess your method name is same as Class Name. Is that right?

If it is yes, then its wrong.Compiler assumes that method as constructor and since it has return type, it wil throw error


CreateCompanyProfile是您的类的名称吗?如果是,则您编写的代码将充当构造函数.构造函数没有返回类型.将下面的代码块更改为以下代码:
Is CreateCompanyProfile name of your class? If yes then the code you wrote acts as a constructor. Constructor do not have return type. Change below block of code to following:
public CreateCompanyProfile( string ComName, byte[] imgbin, string ComTagLine, string ComProfile, int ComEstd, int ComEmpCount, string ComType, string ComTelephone, string ComEmail, string ComFax, string ComAddress, string ComURL, string strmangername, string strmanagerdesign, string strmanagerprof, string ComClients, string CreaterName, string CreaterDesig, string CreaterMailID )



否则将CreateCompanyProfile重命名为CreateDetails或类似的名称.



Else rename CreateCompanyProfile to CreateDetails or something like that.


这篇关于请查找导致此错误的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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