Hi guys pls help me with my problem
this is for my update code
Private Sub BtnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnUpdate.Click
Dim StrSQL As String = "updatePatient"
classLibrary = New ConnectionLibrary
classLibrary.openConnection(strConnection)
'label1.text = databasestatus
If Not classLibrary.isConnectionOpen() Then
Exit Sub
End If
classLibrary.initializeCommand(StrSQL)
classLibrary.addParameter("@IPD_ID", SqlDbType.VarChar, TxtIPD_ID.TextLength, TxtIPD_ID.Text)
classLibrary.addParameter("@LName", SqlDbType.VarChar, TxtLName.TextLength, TxtLName.Text)
classLibrary.addParameter("@FName", SqlDbType.VarChar, TxtFName.TextLength, TxtLName.Text)
classLibrary.addParameter("@MName", SqlDbType.VarChar, TxtMName.TextLength, TxtLName.Text)
classLibrary.addParameter("@Address", SqlDbType.VarChar, TxtAddress.TextLength, TxtAddress.Text)
classLibrary.addParameter("@Birthplace", SqlDbType.VarChar, TxtBirthplace.TextLength, TxtBirthplace.Text)
classLibrary.addParameter("@Birthdate", SqlDbType.VarChar, TxtBirthdate.TextLength, TxtBirthdate.Text)
classLibrary.addParameter("@Age", SqlDbType.VarChar, TxtAge.TextLength, TxtAge.Text)
classLibrary.addParameter("@Sex", SqlDbType.VarChar, TxtSex.TextLength, TxtSex.Text)
classLibrary.addParameter("@Room_ID", SqlDbType.VarChar, TxtRmID.TextLength, TxtRmID.Text)
classLibrary.addParameter("@CivilStatus", SqlDbType.VarChar, TxtCStatus.TextLength, TxtCStatus.Text)
classLibrary.addParameter("@Nationality", SqlDbType.VarChar, TxtNationality.TextLength, TxtNationality.Text)
classLibrary.addParameter("@Religion", SqlDbType.VarChar, TxtReligion.TextLength, TxtReligion.Text)
classLibrary.addParameter("@Date_Admitted", SqlDbType.VarChar, TxtDate_Admitted.TextLength, TxtDate_Admitted.Text)
classLibrary.addParameter("@Date_Discharged", SqlDbType.VarChar, TxtDate_Discharged.TextLength, TxtDate_Discharged.Text)
classLibrary.addParameter("@Time_Admitted", SqlDbType.VarChar, TxtTime_Admitted.TextLength, TxtTime_Admitted.Text)
classLibrary.addParameter("@Time_Discharged", SqlDbType.VarChar, TxtTime_Discharged.TextLength, TxtTime_Discharged.Text)
classLibrary.addParameter("@Chart_ID", SqlDbType.VarChar, TxtChart_ID.TextLength, TxtChart_ID.Text)
classLibrary.addParameter("@Occupation", SqlDbType.VarChar, txtOccupation.TextLength, txtOccupation.Text)
objCommand.ExecuteNonQuery()
refreshlist()
End Sub
and this is my stored procedure for update
ALTER PROCEDURE dbo.updatePatient
(
@IPD_ID varchar(50),@LName varchar(50),@FName varchar(50),@MName varchar(50),@Address varchar(50),@Birthplace varchar(50),@Birthdate varchar(50),@CivilStatus varchar(50),@Nationality varchar(50),@Occupation varchar(50),@Age varchar(50),@Sex varchar(50),@Religion varchar(50),@Date_Admitted varchar(50),@Date_Discharged varchar(50),@Time_Admitted varchar(50),@Time_Discharged varchar(50),@Room_ID varchar(50)
)
AS
update Admission_Record
set LName=@LName,FName=@FName,MName=@MName,Address=@Address,Birthplace=@Birthplace,Birthdate=@Birthdate,CivilStatus=@CivilStatus,Nationality=@Nationality,Occupation=@Occupation,Age=@Age,Sex=@Sex,Religion=@Religion,Date_Admitted=@Date_Admitted,
Date_Discharged=@Date_Discharged,Time_Admitted=@Time_Admitted,Time_Discharged=@Time_Discharged,Room_ID=@Room_ID
WHERE IPD_ID=@IPD_ID;