本文介绍了像'xxxxxxxx(classname)'这样的CS1061错误不包含'updateconfirmstatus'的定义,也没有扩展方法.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个类库Customer的类库有方法
i have a class library with class "Customer" having method
public void updateconfirmstatus(int p, int reg_id, int status)
{
CustomerDac.myupdateconfirmstatus(p, reg_id, status);
}
public static void myupdateconfirmstatus(int p, int reg_id, int status)
{
//Logic...
}
即时通讯使用student.aspx
im using student.aspx
using Myproject.Business;
protected void DoctorDetails_RowUpdating(object sender,GridViewUpdateEventArgs e)
{
try
{
Customer customer = new Customer();
int reg_id = Convert.ToInt32(DoctorDetails.DataKeys[e.RowIndex].Value.ToString());
DropDownList ddlIs_Disabled = (DropDownList)DoctorDetails.Rows[e.RowIndex].FindControl("ddlIs_Disabled");
int status = ddlIs_Disabled.SelectedIndex;
customer.updateconfirmstatus(Convert.ToInt32(Request.QueryString["appid"].ToString()), reg_id, status); // Here Im getting error
DoctorDetails.EditIndex = -1;
bindstudentlist();
}
catch (Exception ex)
{
throw ex;
}
}
尽管我已将库添加到我的项目中,并且我的班级有方法它显示我这样的错误
Eventhough i added library to my project,and my class having method it shows me error like this
'DrugDetails.Business.Customer' does not contain a definition for 'updateconfirmstatus' and no extension method 'updateconfirmstatus' accepting a first argument of type 'DrugDetails.Business.Customer' could be found (are you missing a using directive or an assembly reference?
为什么会发生这种情况以及如何解决这个问题...谢谢......
Why this happens and how to resolve this...Thank you...
推荐答案
Customer.updateconfirmstatus(Convert.ToInt32(Request.QueryString["appid"].ToString()), reg_id, status);
这使用类名而不是实例。
This uses the Class name, rather than the instance.
这篇关于像'xxxxxxxx(classname)'这样的CS1061错误不包含'updateconfirmstatus'的定义,也没有扩展方法.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!