I am having trouble with allowing the user to enter info into fields pressing a submit button which inserts the fields into my access database. It gives me a compile error saying that "System.Data.OleDb.OleDbException: Operation must use an updateable query." Here is the code:
sub Page_Load()
Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=''My data source
Dim objConnection as New OledbConnection(strConnection)
objConnection.Open()
Dim objCmd as New OledbCommand()
objcmd.connection = objconnection
objcmd.commandtext = "insertnewlogin"
objcmd.commandtype = commandtype.storedprocedure
objcmd.parameters.add("@UserID",
oledbtype.varchar).value=userid.text
objcmd.parameters.add("@Password", oledbtype.varchar).value=password.value
objcmd.parameters.add("@Name", oledbtype.varchar).value=name.text
objcmd.parameters.add("@Email", oledbtype.varchar).value=email.text
objcmd.parameters.add("@State", oledbtype.varchar).value=state.text
objcmd.parameters.add("@Question", oledbtype.varchar).value=question.text
objcmd.parameters.add("@Answer", oledbtype.varchar).value=answer.text
objcmd.executenonquery()
objConnection.Close()
end sub
</script>
sub Page_Load()
Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=''My data source
Dim objConnection as New OledbConnection(strConnection)
objConnection.Open()
Dim objCmd as New OledbCommand()
objcmd.connection = objconnection
objcmd.commandtext = "insertnewlogin"
objcmd.commandtype = commandtype.storedprocedure
objcmd.parameters.add("@UserID",
oledbtype.varchar).value=userid.text
objcmd.parameters.add("@Password", oledbtype.varchar).value=password.value
objcmd.parameters.add("@Name", oledbtype.varchar).value=name.text
objcmd.parameters.add("@Email", oledbtype.varchar).value=email.text
objcmd.parameters.add("@State", oledbtype.varchar).value=state.text
objcmd.parameters.add("@Question", oledbtype.varchar).value=question.text
objcmd.parameters.add("@Answer", oledbtype.varchar).value=answer.text
objcmd.executenonquery()
objConnection.Close()
end sub
</script>