jordanhelen
asked on
No Overload for Method Error Asp.net, C#
I am get a "no overload for metod error in the line
"dsEmployeeName = oEmployeeName.GetEmployeeN ame(intEmp loyeeID);"
in the below code. Can some tell me why this error is occurring and show me what to do to correct it:
Thanks!
protected void Page_Load(object sender, EventArgs e)
{
oEmployeeName = new EmployeeOrdersBAL();
lblSystemMessages.Text = "";
lblSuccessMessages.Text = "";
pnlSystemMessages.CssClass = "";
//add in code about success message coming back from add child.
if (Session["oSuccess"] != null)
{
lblSuccessMessages.Text = Session["oSuccess"].ToStri ng();
Session["oSuccess"] = null;
}
if (Session["oEmployeeID"] != null)
{
intEmployeeID = Convert.ToInt32(Session["o EmployeeID "].ToStrin g());
}
if (!IsPostBack)
{
Session["oPageMode"] = null;
if (intEmployeeID > 0)
{
oEmployeeName = new EmployeeOrdersBAL();
try
{
//clear all sessions
Session["oEMPLName"] = null;
DataSet dsEmployeeName = new DataSet();
dsEmployeeName = oEmployeeName.GetEmployeeN ame(intEmp loyeeID);
if (dsEmployeeName != null)
{
DisplayEmployeeName(dsCRPD DDiagnosis .Tables[0] );
}
}
catch
{
}
finally
{
oEmployeeName = null;
}
}
else
{
"dsEmployeeName = oEmployeeName.GetEmployeeN
in the below code. Can some tell me why this error is occurring and show me what to do to correct it:
Thanks!
protected void Page_Load(object sender, EventArgs e)
{
oEmployeeName = new EmployeeOrdersBAL();
lblSystemMessages.Text = "";
lblSuccessMessages.Text = "";
pnlSystemMessages.CssClass
//add in code about success message coming back from add child.
if (Session["oSuccess"] != null)
{
lblSuccessMessages.Text = Session["oSuccess"].ToStri
Session["oSuccess"] = null;
}
if (Session["oEmployeeID"] != null)
{
intEmployeeID = Convert.ToInt32(Session["o
}
if (!IsPostBack)
{
Session["oPageMode"] = null;
if (intEmployeeID > 0)
{
oEmployeeName = new EmployeeOrdersBAL();
try
{
//clear all sessions
Session["oEMPLName"] = null;
DataSet dsEmployeeName = new DataSet();
dsEmployeeName = oEmployeeName.GetEmployeeN
if (dsEmployeeName != null)
{
DisplayEmployeeName(dsCRPD
}
}
catch
{
}
finally
{
oEmployeeName = null;
}
}
else
{
ASKER
Please see the first part of the class.
oEmployeeName is a session variable geting it's value from what the user selects.
oEmployeeName is a session variable geting it's value from what the user selects.
ASKER
oops . . . left it our
Please see the first part of the class.
oEmployeeName is a session variable geting it's value from what the user selects.
public partial class EmployeeOrdersAssessment : System.Web.UI.Page
{
oUserObject oUser = null;
EmployeeOrdersBAL oEmployeeName = null;
int intEmployeeID = 0;
protected void Page_Load(object sender, EventArgs e)
{
oEmployeeName = new EmployeeOrdersBAL(); . . . .
Please see the first part of the class.
oEmployeeName is a session variable geting it's value from what the user selects.
public partial class EmployeeOrdersAssessment : System.Web.UI.Page
{
oUserObject oUser = null;
EmployeeOrdersBAL oEmployeeName = null;
int intEmployeeID = 0;
protected void Page_Load(object sender, EventArgs e)
{
oEmployeeName = new EmployeeOrdersBAL(); . . . .
Had you posted your Class Code.I Can't see that. I can see on the Page_Load section of the ASpx Code-Behind section.and, in that oEmployeeName is not comming from Session. You are creating it with
oEmployeeName = new EmployeeOrdersBAL(); //First line of Page_Load method.
oEmployeeName = new EmployeeOrdersBAL(); //First line of Page_Load method.
ok. Can you tell me where you are initializing the oEmployeeName variable from session.
I can't see that section.
I can't see that section.
ASKER
Thank you!
The "dsEmployeeName = oEmployeeName.GetEmployeeN ame(intEmp loyeeID);"
links to the EmployeeOrdersBAL (business access layer class) it is here where the code that initializes this variable is located.
Also after
}
else
{
there are only error messages.
After the error message, grid binding takes place. See below
protected void DisplayEmployeeName (DataTable dtEmployeeName)
{
try
{
DataView dvEmployeeName = dtEmployeeName.DefaultView ;
dvCEmployeeName.Sort = "ChronologicalAge DESC";
Session["oEMPLName"] = dvEmployeeName;
grdEmployeeResults.DataSou rce = dvEmployeeName;
grdEmployeeResults.DataBin d();
}
catch
{
throw;
}
}
Basically this is all except page sorting, index changing, etc. Ofcourse I am not getting that far. The problem may be in the BAL. What are you thoughts?
The "dsEmployeeName = oEmployeeName.GetEmployeeN
links to the EmployeeOrdersBAL (business access layer class) it is here where the code that initializes this variable is located.
Also after
}
else
{
there are only error messages.
After the error message, grid binding takes place. See below
protected void DisplayEmployeeName (DataTable dtEmployeeName)
{
try
{
DataView dvEmployeeName = dtEmployeeName.DefaultView
dvCEmployeeName.Sort = "ChronologicalAge DESC";
Session["oEMPLName"] = dvEmployeeName;
grdEmployeeResults.DataSou
grdEmployeeResults.DataBin
}
catch
{
throw;
}
}
Basically this is all except page sorting, index changing, etc. Ofcourse I am not getting that far. The problem may be in the BAL. What are you thoughts?
friend, i think the problem is with the line
oEmployeeName.GetEmployeeN ame(intEmp loyeeID)
if possible ,then please check your B.L ,and make sure that oEmployeeName object contains the GetEmployeeName method whitch takes the integer parameter.
oEmployeeName.GetEmployeeN
if possible ,then please check your B.L ,and make sure that oEmployeeName object contains the GetEmployeeName method whitch takes the integer parameter.
ASKER
Yes, I agree, it is in that line. The GetEmployeeName method is in the BL and this method is set to the variable oEmployeeName when it is declared in the .aspx behind code.
Thanks for your help.
Thanks for your help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No Comments.
Check the Method argument type of
oEmployeeName.GetEmployeeN
Is it of Int type or what??
As your error shows that there is not method in oEmployeeName with the name GetEmployeeName which aspect the int parameter.