C#Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
i'm doing a connection to an oracle database with visual c#.
I now my programs must have a look like this:
public void ConnectToOracle()
{
OracleClient.OracleConnection conn =
new OracleClient.OracleConnection ();
// TODO: Modify the connection string and include any
// additional required properties for your database.
conn.ConnectionString = "Data Source=" +
"<oracle data source name>;Integrated Security=yes";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception ex)
{
MessageBox.Show("Failed to connect to data source");
}
finally
{
conn.Close();
}
}
my problem is how can i access to the class "oracleconnection". it belongs to:
You'll need an assembly reference to the assembly that contains that class. For the oracle client it's the System.Data.OracleClient.dll assembly of the framework.
In your solution explorer right click on References-->Add Reference. Select System.Data.OracleClient.dll in .Net tab and then press ok. Then make sure you'll see System.Data.OracleClient.dll has added to your References.