| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi,
I am pretty new to Oracle and connecting it to ASP.Net web applications. I am designing a web application where i am establishing a connection with oracle database and i am inserting records in it using the following code: ----------------------------------------------------------- protected void Button1_Click(object sender, EventArgs e) { OracleConnection sconn=new OracleConnection(@"// Connection String //"); string inscmd="insert into STUDENTS values (a,b,c,d)"; OracleCommand scomm=new OracleCommand(inscmd,sconn); scomm.Parameters.Add(new OracleParameter("a",OracleType.VarChar,12)); scomm.Parameters["a"].Value=ID.Text; scomm.Parameters.Add(new OracleParameter("b",OracleType.VarChar,30)); scomm.Parameters["b"].Value=Name.Text; scomm.Parameters.Add(new OracleParameter("c",OracleType.Number,1)); scomm.Parameters["c"].Value=Convert.ToInt32(Sem.Text); scomm.Parameters.Add(new SqlParameter("d", OracleType.Number, 4)); scomm.Parameters["d"].Value = Convert.ToInt32(Code.Text); scomm.Connection.Open(); scomm.ExecuteNonQuery(); //THIS IS WHERE THE ERROR OCCURS scomm.Connection.Close(); Button2.Visible = true; } ---------------------------------------------------------- However on compiling i am getting an error: ORA-01036:invalid variable name/number on the line "scomm.ExecuteNonQuery();" Please help me by resolving the error...i am not whether the error is due the wrong usage of datatypes(though they are consistent with those of the underlying database) or due to some other reason... Urgent help needed... Thnx in advance!! |
![]() |
| Viewing: Tutorialized Forums > Web Design & Development > ASP.NET > Ora-01036 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|