Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[req] how to check whether given oracle table exist or not + C#

686292Feb 19 2009 — edited Feb 20 2009
Hi,
All.

Actually i m creating a program using C# which connects to the database (oracle) and checks for the given table "OPC_GROUP". if the table doesnt exists then it creates the table else it updates all field with provided values

code

cmd.CommandText = "SELECT tname from tab where tname = 'OPC_GROUP'";

cmd.CommandType = CommandType.Text;
int length = cmd.ExecuteNonQuery();
if (cmd.ExecuteNonQuery() >0)
{
MessageBox.Show("Table does exist");
}
else
MessageBox.Show("Table doesnt exist");



But this code return "TABLE DOESNT EXIST" though table is already created

What i m doing wrong???

Please help..........

Thnx in advance
This post has been answered by gdarling - oracle on Feb 20 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 20 2009
Added on Feb 19 2009
2 comments
1,499 views