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 in Oracle
Dec 2 2004 7:11 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.. I got lots of errors :(( private void OnButton_Click(object sender, System.EventArgs e) { OracleConnection myConnection = new OracleConnection(myRegistry.getRegistryValue("connectionString")); myConnection.Open (); String insertCmd = "nsert 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("patient_number", OracleType.Number, 5, "PATIENT_NUMBER"); myCommand.Parameters.Add("patient_name", OracleType.VarChar, 20,"PATIENT_NAME"); myCommand.Parameters.Add("patient_lastname", OracleType.VarChar, 20,"PATIENT_LASTNAME"); myCommand.ExecuteNonQuery(); BindGrid(myConnection); myConnection.Close (); } public void BindGrid() { OracleDataAdapter myCommand = new OracleDataAdapter("SELECT * FROM PATIENTS", myConnection); DataSet myDataSet = new DataSet(); myCommand.Fill(myDataSet); dataGrid1.DataSource=myDataSet; dataGrid1.DataBind(); }
Reply
Answers (
2
)
Stored Procedure help.... Loop with changing variables
connecting on access database that has security?