public void InsertRow(string myConnectionString)
{
// If the connection string is empty, use default.
if(myConnectionString == "")
{
myConnectionString =
"User Id=Scott;Password=tiger;Data Source=Ora;";
}
OracleConnection myConn = new OracleConnection(myConnectionString);
string myInsertQuery = "INSERT INTO DEPT VALUES (50,'Development','Philadelphia')";
OracleCommand myCommand = new OracleCommand(myInsertQuery);
myCommand.Connection = myConn;
myConn.Open();
try
{
myCommand.ExecuteNonQuery();
}
finally
{
myConn.Close();
}
}