![]() |
insert into table problem in Oracle dataBase Through CommandText.Text
Dear sir,
i am new to ASP.NET programming ,through c#. In my web project,i am inserting into SqlServer Database through Command.Text method.It is working fine. Below i am giving the code for SqlServer database table. Code:
...Code:
...Build is successful but, It gave the following runtime error:- Error at : oracmd.ExecuteNonQuery(); OracleException was unhandled by the user code ORA-01036: illegal variable name/number plz help me ... |
Re: insert into table problem in Oracle dataBase Through CommandText.Text
Use Exception Handling to trace the error.
Find the function in which you are getting the error. From the code I see only 1 problem; syntax error in below line. String orasel="select *from T6"; Correct code: String orasel="select * from T6"; |
Re: insert into table problem in Oracle dataBase Through CommandText.Text
main problem is in this statement:
oracmd.ExecuteNonQuery(); . Because oracle is returnong some error at run time,when i am inserting value through CommandText.Text. And there is no problem in simple insert. Even when i am using SQL Server Database it is working fine,but it returns error for oracle DataBase.. Exception handling will not solve my problem..plz any one help |
Re: insert into table problem in Oracle dataBase Through CommandText.Text
Try this:
replace @ with colon Quote:
Quote:
String orains = "insert into T6 values('" & TextBox1.Text.ToString() & "')"; |
Re: insert into table problem in Oracle dataBase Through CommandText.Text
oh! thanks a lot...it is working fine.
So main problem was with oracle data provider...is'nt it.. |
Re: insert into table problem in Oracle dataBase Through CommandText.Text
what did you modify that solved your problem?
|
Re: insert into table problem in Oracle dataBase Through CommandText.Text
As you said, i replaced all the '@' symbols with ':' symbols and my problem is solved.
|
Re: insert into table problem in Oracle dataBase Through CommandText.Text
Good. Thanks for confirmation.
|
| All times are GMT +5.5. The time now is 12:51. |