Home
Manage Your Code
Snippet: OracleCommand (C#)
Title: OracleCommand Language: C#
Description: Sample Views: 174
Author: Paulo Almeida Date Added: 12/30/2007
Copy Code  
1OracleConnection oConn = new OracleConnection(strConn);
2                    
3                try
4                {
5                    oConn.Open();
6                    OracleCommand oCmd = new OracleCommand(sSQL, oConn);
7                    oCmd.CommandText = sSQL;
8                    oCmd.CommandType = System.Data.CommandType.Text;
9                    oCmd.ExecuteStream();
10                }
11                catch (Exception ex) // catches any error
12                {
13                    Console.WriteLine(ex.Message.ToString());
14                }
15                finally
16                {
17                    oConn.Close();
18                    oConn.Dispose();
19
20                }