| | |
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 algorithm animation array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml





