i am sending code below....
The class file code is..
public DataTable gridviewfetch(int sr_no, string contractor_name, string labour_name, string shift, string entry_time, string exit_time, string location, string job_desc, string start_time, string end_time, string OT_from, string OT_end, string OT_reason)
{
library lib = new library();
DataTable dtdetailview = new DataTable();
dtdetailview = lib.GetconDetail(sr_no);
return dtdetailview;
}
and aspx.cs page code is ....
private void fillgrid()
{
DataTable dttab = cons.gridviewfetch();
if (dttab.Rows.Count > 0)
{
GridView1.DataSource = dttab;
GridView1.DataBind();
}
i am getting error like "no overload for method takes gridviewfetch '0' arguments...." I tried like took 0 argument also.
like
public DataTable gridviewfetch()
{
}
please solve that problem....
thanks....
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ShambhuPosted Aug 21, 2010, 10:34 AM
As I can see in your class file method there is no any method which have 0 argument function. So that You are getting correct error message. The
gridviewfetch(int sr_no, string contractor_name, string labour_name, string shift, string entry_time, string exit_time, string location, string job_desc, string start_time, string end_time, string OT_from, string OT_end, string OT_reason)
has no. of parameters but while calling you are not passing as no. of parameters you have defined in your class gridviewfetch() method. So its not finding any method which have 0 parameter. So that u are getting error.
Create same signature method what you are calling. Same signature means no. of parameters and data types should match with calling method.
Try this and let me know if You get any error again.