| | |
Overloading method
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 30
Reputation:
Solved Threads: 0
Hello all,
I have overloading method problem with my miniproject. The code is below :
Error is : no overload for UpdatePatientsDetail takes '2' arguments
Code for this method is :
I can't fix the error. Any help will be appreciated. Thank you.
I have overloading method problem with my miniproject. The code is below :
C# Syntax (Toggle Plain Text)
patients.UpdatePatientsDetail(patientsidTextBox.Text, patientsnameLabel1.Text);
Error is : no overload for UpdatePatientsDetail takes '2' arguments
Code for this method is :
C# Syntax (Toggle Plain Text)
public void UpdatePatientsDetail(string strPatientsID, string strPatientsName, string strPatientsAddress, string strPatientsTelephonenumber, string strPatientsDateofBirth, string strPatientsNric, string strPatientsEmailAdress, string strPatientsApponitmentTime) { string SQL; SQL = "UPDATE Patients SET PatientsName = '" + strPatientsName + "', PatientsAddress = '" + strPatientsAddress + "', PatientsTelephonenumber = '" + strPatientsTelephonenumber + "', PatientsDateofBirth = '" + strPatientsDateofBirth + "', PatientsNric = '" + strPatientsNric + "', PatientsEmailAdress = '" + strPatientsEmailAdress + "', PatientsAppointmentTime = '" + strPatientsApponitmentTime + "' where PatientsID = " + strPatientsID + ""; ExecuteDataCommand(SQL); }
I can't fix the error. Any help will be appreciated. Thank you.
•
•
Join Date: Jul 2008
Posts: 30
Reputation:
Solved Threads: 0
Thank you for your reply.
I still got error can't overload the method.
The method is below :
How to fix it? I passed enough parameters but still got error. Thanks.
I still got error can't overload the method.
C# Syntax (Toggle Plain Text)
consu.UpdateConsultationDetail(consultationidTextBox.Text, consultationdateTextBox.Text, patientspastillnessComboBox.Items.Add, patientspastdiagnosisComboBox.Items.Add, patientscurrentillnessTextBox.Text, patientscurrentdiagnosisComboBox.Items.Add);
The method is below :
C# Syntax (Toggle Plain Text)
public void UpdateConsultationDetail(string strConsultationID, string strDiagnosis, string strConsultationDate, string strPatientsPastIllness, string strPatientsCurrentIllness, string strPatientsPastDiagnosis, string strPatientsCurrentDiagnosis) { string SQL; SQL = "UPDATE Consultation SET ConsultationDate = '" + strConsultationDate + "', PatientsPastIllness = '" + strPatientsPastIllness + "', PatientsPastDiagnosis = '" + strPatientsPastDiagnosis + "', PatientsCurrentDiagnosis = '" + strPatientsCurrentDiagnosis + "', PatientsCurrentIllness = '" + strPatientsCurrentIllness + "' where ConsultationID = " + strConsultationID + ""; ExecuteDataCommand(SQL); }
How to fix it? I passed enough parameters but still got error. Thanks.
Last edited by Hannahlv; Aug 5th, 2008 at 12:44 am.
•
•
Join Date: Aug 2008
Posts: 2
Reputation:
Solved Threads: 0
That's easy way here.
Your method :
changed into:
consu.UpdateConsultationDetail(consultationidTextBox.Text, consultationdateTextBox.Text, patientspastillnessComboBox, patientspastdiagnosisComboBox, patientscurrentillnessTextBox.Text, patientscurrentdiagnosisComboBox);
after doing this,
you can choose items in CheckBox in the method by
(String)patientspastillnessComboBox.Items[INDEX_NUM]; // INDEX_NUM: 0 ~ n(existed item number)
I hope this reply help you.
Your method :
•
•
•
•
consu.UpdateConsultationDetail(consultationidTextBox.Text, consultationdateTextBox.Text, patientspastillnessComboBox.Items.Add, patientspastdiagnosisComboBox.Items.Add, patientscurrentillnessTextBox.Text, patientscurrentdiagnosisComboBox.Items.Add);
consu.UpdateConsultationDetail(consultationidTextBox.Text, consultationdateTextBox.Text, patientspastillnessComboBox, patientspastdiagnosisComboBox, patientscurrentillnessTextBox.Text, patientscurrentdiagnosisComboBox);
after doing this,
you can choose items in CheckBox in the method by
(String)patientspastillnessComboBox.Items[INDEX_NUM]; // INDEX_NUM: 0 ~ n(existed item number)
I hope this reply help you.
•
•
Join Date: Jun 2006
Posts: 37
Reputation:
Solved Threads: 2
•
•
•
•
Thanks for the reply now the problem is that i dont know where to add this code String)patientspastillnessComboBox.Items[INDEX_NUM]; // INDEX_NUM: 0 ~ n(existed item number)
Change the code of all combobox.
from:
patientspastdiagnosisComboBox.Items.Add
to:
patientspastdiagnosisComboBox.SelectedItem.ToString()
![]() |
Similar Threads
- Overloading PHP Functions (PHP)
- Overloading / Redefining / Overriding (C++)
- Operator Overloading HELP! (C++)
- Operator Overloading (C++)
- Program Involving Overloading (C++)
- Overloading the increment operator plz help (C++)
- overloading << (C++)
Other Threads in the C# Forum
- Previous Thread: problem after file modification with formatting
- Next Thread: Gif image Extraction
| Thread Tools | Search this Thread |
.net access activedirectory algorithm array barchart bitmap box broadcast buttons c# check checkbox client combobox connect control conversion cryptographyc#winformsencryption csharp custom database datagrid datagridview dataset datetime degrees development disabled displayingopenforms draganddrop drawing encryption enum event excel file foreach form format forms ftp function gdi+ httpwebrequest image index index-error input install java label list listbox listview mandelbrot math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox security server setup sleep socket sql statistics stream string table text textbox thread time timer totaldays update user usercontrol validation visual visualstudio webbrowser windows winforms wpf xml





