Sunday, May 1, 2011

Defining and Accessing Oracle Connection in app.cong

Step 1:- Add a app.conf file to your windows project.

a) To do this go to solution explorer, right click over the project sln to add a new item, a Add New Item Dialog box appear in fort of you.

b) from Add New Item Dialog box choose Application Configuration File.

Step 2:- In app.conf file define Oracle Connection.

Ex:-








Step 3:- Code for accessing this define connection string in .cs page.

Ex:-
using System.Data.OracleClient;
OracleConnection con = new OracleConnection ( System.Configuration. ConfigurationManager.AppSettings["OracleConnection"].ToString());