Skip to content

Connection to oracle database

georgeskaddoum

Asked Apr 15, 2004, 1:55 AM EDT2 answers
Share
LinkedInX
how can i insert data into an oracle databse?

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Create a connection object with the proper connection string to your Oracle database. Create a command object from the connection object. Create a command (I use commandtext and SQL) and execute the command object's ExecuteNonQuery method.
    0
  • 0
    I am giving small code for inserting data into oracle database : You should change the values of data source, user id, password. For example here i take a Student table with two fields Rno and Name dim Con As OleDb.OleDbConnection dim Qry as string Con = New OleDb.OleDbConnection("Provider=MSDAORA; Data Source = xdpi; User Id = data_sys; Password = validation") Con.Open() Qry = "Insert Into Student(Rno, Name) Values (" & Val(TxtRNo.Text) & ",'" & Trim(TxtName.Text) & "')" Dim Cmd As New OleDb.OleDbCommand(Qry, Con) Cmd.ExecuteNonQuery()
    0