Dear All,
When i execute my queries for Edit and Save for edited subject, there is no updated in my sql database. Appreciate if anyone could lend me a hand for this issue.
My queries are as below.
Private ConnString As String = "server=localhost; Integrated Security=SSPI;Persist Security Info=False;database=carerpt"
Public Sub UpdateMyData(ByVal myConnString As String, ByVal Meeting_Subject As String, ByVal Meeting_Date As String, ByVal StartTime_Planned As String, ByVal EndTime_Planned As String, ByVal StartTime_Actual As String, ByVal EndTime_Actual As String, ByVal ChairedBy As String, ByVal Department As String, ByVal Logged_By As String)
Dim myInsertQuery As String = "Update Meeting Set Meeting_Date = "", StartTime_Planned = "", EndTime_Planned = "", StartTime_Actual = "", EndTime_Actual = "", ChairedBy = "", Department = "" , Logged_By = "" Where ( Meeting_Subject = '" + Meeting_Subject + "' )"
Dim myConnection As New SqlConnection(myConnString)
Dim myCommand As New SqlCommand(myInsertQuery, myConnection)
'Dim retvalue As Integer
myConnection.Open()
'retvalue = myCommand.ExecuteNonQuery()
myConnection.Close()
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim fieldName1 As String = txtMeetingSubject.Text
Dim fieldName2 As String = txtMeetingDate.Text
Dim fieldName3 As String = txtStartTime_Planned.Text
Dim fieldName4 As String = txtEndTime_Planned.Text
Dim fieldName5 As String = txtStartTime_Actual.Text
Dim fieldName6 As String = txtEndTime_Actual.Text
Dim fieldName7 As String = txtChairedBy.Text
Dim fieldName8 As String = txtDepartment.Text
Dim fieldName9 As String = txtLoggedBy.Text
UpdateMyData(ConnString, fieldName1, fieldName2, fieldName3, fieldName4, fieldName5, fieldName6, fieldName7, fieldName8, fieldName9)
End Sub