nicks60610
MIS
I am sure it is my usual Friday tired mind that's not seeing the issue, or could even be my brain being dead in general :- ) , I am running a report with edit functionality and that works great, until I want to update the data on my SQL server, it keeps erroring out on my SQL update statement...
I am sure it is something really dumb I am not seeing...by the way, the session variables do produce valid values, tested those with response.write statements in the Sub below (while commenting out the database update statement).
Thanks for any help..
Sub DataGrid1_Update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
Dim strProblemDescription = e.Item.Cells(3).Text
Dim strSavingsAnalysis = e.Item.Cells(7).Text
Dim strQualityAnalysis = e.Item.Cells(9).Text
Dim strSafetyAnalysis = e.Item.Cells(11).Text
Dim strUpdate As String
strUpdate = "Update Kaizen Set ProblemDescription = strProblemDescription and
SavingsAnalysis = strQualityAnalysis and
strSafetyAnalysis where Date = " & Session("Date") & "
and FirstName = " & Session("FirstName") & " and
Title = " & Session("Title") & ""
Const StrConnString As String = "server=srvname;uid=userID;pwd=pwds;database=DB"
Dim objConn2 As New SqlConnection(StrConnString)
objConn2.Open()
Dim cmdUpdate As SqlCommand
cmdUpdate = New SqlCommand(strUpdate, objConn2)
cmdUpdate.ExecuteNonQuery()
objConn2.Close()
DataGrid1.EditItemIndex = -1
BindData()
End Sub
I am sure it is something really dumb I am not seeing...by the way, the session variables do produce valid values, tested those with response.write statements in the Sub below (while commenting out the database update statement).
Thanks for any help..
Sub DataGrid1_Update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
Dim strProblemDescription = e.Item.Cells(3).Text
Dim strSavingsAnalysis = e.Item.Cells(7).Text
Dim strQualityAnalysis = e.Item.Cells(9).Text
Dim strSafetyAnalysis = e.Item.Cells(11).Text
Dim strUpdate As String
strUpdate = "Update Kaizen Set ProblemDescription = strProblemDescription and
SavingsAnalysis = strQualityAnalysis and
strSafetyAnalysis where Date = " & Session("Date") & "
and FirstName = " & Session("FirstName") & " and
Title = " & Session("Title") & ""
Const StrConnString As String = "server=srvname;uid=userID;pwd=pwds;database=DB"
Dim objConn2 As New SqlConnection(StrConnString)
objConn2.Open()
Dim cmdUpdate As SqlCommand
cmdUpdate = New SqlCommand(strUpdate, objConn2)
cmdUpdate.ExecuteNonQuery()
objConn2.Close()
DataGrid1.EditItemIndex = -1
BindData()
End Sub