[req] how to check whether given oracle table exist or not + C#
686292Feb 19 2009 — edited Feb 20 2009Hi,
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