SQL Error near '(' - Kan bara inte hitta felet !? Kan ni? :l
Skulle tacksamt ta emot en fingervisning i sådana fall :)
Resultat när jag skrivit ut SQL:en:
UPDATE tblSchDiff (ForID, AddBy, AddDate, ModBy, ModDate, Name, Shorttext1, Published) VALUES (78, -2, '2006-10-13 01:05:43', -2, '2006-10-13 01:05:43', 'Tae Kwondo', 'wert', 0) WHERE (Id = 55 )
Koden i sig:
Dim SQL As String = "UPDATE " & sTabelNamn & " ( ForeningID, AddBy, AddDate, ModBy, ModDate, Name" & Session("EditLanguage") & ", Shorttxt" & ", Published" & Session("EditLanguage") & " ) VALUES ( " & Session("Forening_user") & ", -2, '" & Now & "', -2,'" & Now & "', '" & Replace(Name.Text, "'", "''") & "', '" & Replace(Shorttext.Text, "'", "''") & "', " & Int(Published.Checked) & " WHERE Id = " & Request.QueryString("Id") & " )"
Dim Conn As New SqlConnection(strConn)
Dim Command As New SqlCommand(SQL, Conn)
Conn.Open()
Response.Write(SQL)
Try
Command.ExecuteNonQuery()
Session("bw_SendTo") = "/reg/func/sced/diff_edit.aspx?Id=" & Request.QueryString("Id") & "&Action=SaveFile&Table=" & sTableName & "&Field=" & field & ""
Response.Write("<br>")
Response.Write(Session("bw_SendTo"))
Conn.Close()
Response.Redirect("/admin/m_fg.aspx?d=/kategori/underkategori/item&R=1")
Catch ex As SqlException
ActionDone.ForeColor = System.Drawing.Color.Red
ActionDone.Text = " - Någonting gick fel <img src=""/admin/images/inf.gif"" border=""0"" align=""absBottom"">"
ActionDone.ToolTip = " Meddelande: " & ex.Message & vbCrLf & " Källa: " & ex.Source
Finally
Conn.Close()
End Try
Tack för din uppmärksamhet... :)