Click here to Skip to main content
15,891,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
StudentWebService.StudentWebService mStudentWS = new StudentWebService.StudentWebService();

if (mStudentWS.save(mStudentInfo, mSubjectInfoList))
        {
            hidmitvalue.Value = Convert.ToString(mStudentInfo.SysKey);
            butNew.Visible = true;
            butUpdate.Visible = true;
            butDelete.Visible = true;
            butSave.Visible = false;
            Common.ShowMessage("Save Successfully", this.Page);
            result = true;
        }



when compile this code, Error show:

Error	1	No overload for method 'save' takes 0 arguments<br />
Error	2	The best overloaded method match for 'StudentWebService.StudentWebService.save(StudentWebService.StudentInfo, StudentWebService.SubjectInfo[])' has some invalid arguments<br />
Error	3	Argument 1: cannot convert from 'Student.Info.StudentInfo' to 'StudentWebService.StudentInfo'<br />
Error	4	Argument 2: cannot convert from 'System.Collections.Generic.List<Student.Info.SubjectInfo>' to 'StudentWebService.SubjectInfo[]'


pls give me suggestions for this errors
Posted
Updated 15-Jul-11 23:07pm
v2

1 solution

Message is clear, the params you are passing to the save methods have something wrong. I suppose that you are trying to pass an List<> as a second parameter, meanwhile the method is expecting the array of SubjectInfo.

Try to call it in this way:

if (mStudentWS.save(mStudentInfo, mSubjectInfoList.ToArray()))



Cheers!
 
Share this answer
 
v2
Comments
Mohammad A Rahman 17-Jul-11 22:00pm    
Agree with Mario.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900