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
aylin_sk
NA
87
0
insertcmd
Dec 2 2004 5:22 AM
Hi, I created a web form including insert button..After I enter some values into the fields, I want them to be inserted into Oracle database..Is my script right??Or if I'm wrong in somewhere in my script, please inform me about it.. String insertCmd = "insert into PATIENTS (PATIENT_NUMBER," + " PATIENT_NAME, PATIENT_LASTNAME)" + " values (:patient_number, :patient_name, :patient_lastname)", myConnection); OracleCommand myCommand = new OracleCommand(insertCmd, myConnection); myCommand.Parameters.Add(new OracleParameter("patient_number", OracleType.Number, 5, "PATIENT_NUMBER")); myCommand.Parameters.Add(new OracleParameter("patient_name", OracleType.VarChar, 20,"PATIENT_NAME")); myCommand.Parameters.Add(new OracleParameter("patient_lastname", OracleType.VarChar, 20,"PATIENT_LASTNAME")); myCommand.Connection.Open(); myCommand.Connection.Close(); BindGrid(); public void BindGrid() { OracleConnection myConnection = new OracleConnection(myRegistry.getRegistryValue("connectionString")); OracleDataAdapter myCommand = new OracleDataAdapter("SELECT * FROM" + " PATIENTS", myConnection); DataSet myDataSet = new DataSet(); myCommand.Fill(myDataSet); dataGrid1.DataSource=myDataSet; dataGrid1.DataBind(); }
Reply
Answers (
2
)
Connectivity of C# with Oracle
Downloading files and ListBox