TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
matharu007
NA
1
0
INSERTING DATA INTO ORACLE DATABASE
Jun 16 2004 7:09 AM
Hi, i have a simple query to insert data from windows form to oracle database. connection is correct and select and delete queries are working. but problem is with insert query Help me plz. Dim conn_obj As New OleDbConnection(conn_str) conn_obj.Open() Dim qur As String = "INSERT INTO EMP(EMPNO, ENAME, JOB, HIREDATE, SAL, SEX) VALUES(@EMPNO, @ENAME, @JOB, @HIREDATE, @SAL, @SEX)" Dim comm_obj As New OleDbCommand(qur, conn_obj) Dim p1 As OleDbParameter Dim p2 As OleDbParameter Dim p3 As OleDbParameter Dim p4 As OleDbParameter Dim p5 As OleDbParameter Dim p6 As OleDbParameter Dim p7 As OleDbParameter Dim p8 As OleDbParameter p1 = comm_obj.Parameters.Add("@EMPNO", OleDbType.Numeric, 4) p1.SourceColumn = "EMPNO" p1.Value = CType(txtId.Text, Integer) p2 = comm_obj.Parameters.Add("@ENAME", OleDbType.VarChar, 10) p2.SourceColumn = "ENAME" p2.Value = txtNam.Text p3 = comm_obj.Parameters.Add("@JOB", OleDbType.VarChar, 9) p3.SourceColumn = "JOB" p3.Value = txtJob.Text p4 = comm_obj.Parameters.Add("@HIREDATE", OleDbType.Date) p4.SourceColumn = "HIREDATE" p4.Value = CType(txtHirDat.Text, Date) p5 = comm_obj.Parameters.Add("@SAL", OleDbType.Decimal, 7) p5.SourceColumn = "SAL" p5.Value = CType(txtSal.Text, Decimal) If radMal.Checked = True Then p6 = comm_obj.Parameters.Add("@SEX", OleDbType.VarChar, 2) p6.SourceColumn = "SEX" p6.Value = "M" ElseIf radFem.Checked = True Then p6 = comm_obj.Parameters.Add("@SEX", OleDbType.VarChar, 2) p6.SourceColumn = "SEX" p6.Value = "F" End If comm_obj.ExecuteNonQuery() conn_obj.Close()
Reply
Answers (
1
)
Help me
Icon Tray MessageBox...