egil84
Programmer
- Oct 19, 2003
- 13
'm trying to create table through this method. It connects to my database, it givs me a message that it was created but when I want to insert data through my form into the table, it says that the row/column/table doesn't exist. What am I doing wrong? Any help would be greatly appreciated. Thanks in advance.
Code:
//set up connection string
string connectionString =
"Provider = OraOLEDB.Oracle;DataSource = csbank;User ID = system;Password = manager";
//create connection object and pass info to it
OleDbConnection myOleDbConnection =
new OleDbConnection(connectionString);
//string with the creation of table
string query = //got this down
//set up commands object and send the query
OleDbCommand myOleDbCommand = new OleDbCommand(query,myOleDbConnection);
//create object so we can read the data (data reader)
OleDbDataReader datareader = null;
//open DB
myOleDbConnection.Open();
//execute the reader
datareader = myOleDbCommand.ExecuteReader();
//close reader
datareader.Close();
//close connection
myOleDbConnection.Close();
myOleDbConnection.Dispose();