Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 22nd, 2004, 09:08 PM
Authorized User
 
Join Date: Jan 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Err about Insert Data to Oracle

Hi All,
I have a problem about insert command in web form ( MovieStyle.aspx).I'd like to insert data to oracle database by click on button( CmdSubmit ).But,it shows this error

ORA-01036 : Illegal variable name/ number

and this is my coding :

*************************************
Public Class MovieStyle
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.OracleConnection1 = New System.Data.OracleClient.OracleConnection
        Me.OracleSelectCommand1 = New System.Data.OracleClient.OracleCommand
        Me.OracleInsertCommand1 = New System.Data.OracleClient.OracleCommand
        Me.OracleUpdateCommand1 = New System.Data.OracleClient.OracleCommand
        Me.OracleDeleteCommand1 = New System.Data.OracleClient.OracleCommand
        Me.OracleDataAdapter1 = New System.Data.OracleClient.OracleDataAdapter
        Me.DataMovieStyle1 = New WebApplication1.DataMovieStyle
        CType(Me.DataMovieStyle1, System.ComponentModel.ISupportInitialize).BeginIni t()
        '
        'OracleConnection1
        '
        Me.OracleConnection1.ConnectionString = "user id=scott;integrated security=False;data source=orcl;password=tiger"
        '
        'OracleSelectCommand1
        '
        Me.OracleSelectCommand1.CommandText = "SELECT * FROM TBLMOVIESTYLE"
        Me.OracleSelectCommand1.Connection = Me.OracleConnection1
        '
        'OracleInsertCommand1
        '
        Me.OracleInsertCommand1.CommandText = "INSERT INTO TBLMOVIESTYLE (MVS_MOVIESTYLENAME) VALUE(?)"
        Me.OracleInsertCommand1.Connection = Me.OracleConnection1
        Me.OracleInsertCommand1.Parameters.Add(New System.Data.OracleClient.OracleParameter("MVS_MOVI ESTYLENAME", System.Data.OracleClient.OracleType.VarChar))
        '
        'OracleDataAdapter1
        '
        Me.OracleDataAdapter1.DeleteCommand = Me.OracleDeleteCommand1
        Me.OracleDataAdapter1.InsertCommand = Me.OracleInsertCommand1
        Me.OracleDataAdapter1.SelectCommand = Me.OracleSelectCommand1
        Me.OracleDataAdapter1.UpdateCommand = Me.OracleUpdateCommand1
        '
        'DataMovieStyle1
        '
        Me.DataMovieStyle1.DataSetName = "DataMovieStyle"
        Me.DataMovieStyle1.Locale = New System.Globalization.CultureInfo("en-US")
        CType(Me.DataMovieStyle1, System.ComponentModel.ISupportInitialize).EndInit( )

    End Sub
    Protected WithEvents TxtMovieStyle As System.Web.UI.WebControls.TextBox
    Protected WithEvents LblMovieStyle As System.Web.UI.WebControls.Label
    Protected WithEvents OracleConnection1 As System.Data.OracleClient.OracleConnection
    Protected WithEvents OracleSelectCommand1 As System.Data.OracleClient.OracleCommand
    Protected WithEvents OracleInsertCommand1 As System.Data.OracleClient.OracleCommand
    Protected WithEvents OracleUpdateCommand1 As System.Data.OracleClient.OracleCommand
    Protected WithEvents OracleDeleteCommand1 As System.Data.OracleClient.OracleCommand
    Protected WithEvents OracleDataAdapter1 As System.Data.OracleClient.OracleDataAdapter
    Protected WithEvents DataMovieStyle1 As WebApplication1.DataMovieStyle
    Protected WithEvents CmdCancel As System.Web.UI.WebControls.Button
    Protected WithEvents CmdSubmit As System.Web.UI.WebControls.Button

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

    Private Sub CmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSubmit.Click
        OracleConnection1.Open()
        OracleDataAdapter1.InsertCommand.Parameters("MVS_M OVIESTYLENAME").Value = TxtMovieStyle.Text
        OracleDataAdapter1.InsertCommand.ExecuteNonQuery()


    End Sub
End Class

************************************
How should i solve this error?

Thanks in advance

Blueman137






Similar Threads
Thread Thread Starter Forum Replies Last Post
connection string to Oracle, Invalid Argument,err sparsh2010 Access VBA 1 February 14th, 2008 08:31 AM
insert image in to oracle blob data type rajesh_bamane Pro VB Databases 3 July 15th, 2006 02:06 AM
How to Read Oracle Data without Oracle being insta badrinarayanang Oracle 1 October 6th, 2005 06:34 AM
JSP form values to Oracle table (Insert) gokul_blr JSP Basics 1 August 17th, 2004 12:59 AM
err 2580 - data source not found DavidCC SQL Server 2000 4 April 1st, 2004 03:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.