| | |
Overloading method
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 798 | Replies: 8
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap broadcast button buttons c# check checkbox class client code color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing event excel file files form format forms ftp function gdi+ http httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator path picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





