update on gridview produces ORA-01036: illegal variable name/number
537257Oct 13 2006 — edited Mar 6 2008Hello
I have a gridview and tried to use data binding to update the records. I've tried all sorts of things even tried the code below.
The code below updates the record, but I also get this annoying ORA-01036: illegal variable name/number error all the time.
I have no idea on how to fix it.
Here's the code:
aspx.vb file:
Protected Sub gvContacts_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles gvContacts.RowUpdating
Dim s As SqlDataSource = contactSqlDataSource
Dim sqlString As String = "update contactsm1 " _
+ " set first_name = :pFirstName , " _
+ " last_name = :pLastName , " _
+ " email = :pEmail , " _
+ " room = :pRoom , " _
+ " contact_phone = :pPhone " _
+ "where contact_name = :pContactName"
s.UpdateParameters.Add(New Parameter("pContactName", TypeCode.String, e.Keys("CONTACT_NAME")))
s.UpdateParameters.Add(New Parameter("pLastName", TypeCode.String, e.NewValues("LAST_NAME")))
s.UpdateParameters.Add(New Parameter("pFirstName", TypeCode.String, e.NewValues("FIRST_NAME")))
s.UpdateParameters.Add(New Parameter("pEmail", TypeCode.String, e.NewValues("EMAIL")))
s.UpdateParameters.Add(New Parameter("pPhone", TypeCode.String, e.NewValues("CONTACT_PHONE")))
s.UpdateParameters.Add(New Parameter("pRoom", TypeCode.String, e.NewValues("ROOM")))
s.UpdateCommand = sqlString
s.Update()
End Sub
Can anyone help?
Thanks
Peter