I'm connecting to Microsoft SQL and Oracle database. To connect to SQL , I have this code in my web.config
Code:<connectionStrings> <add name="BITESampleDBConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings>
Inside my application I'm using this code to connect to oracle :
Code:Try conn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=XE ;User ID=username;Password=password" conn.Open() Catch 'DISPLAYING CONNECTION STATUS '---------------------------- Response.Write("Unable to connect to Database ") Response.Write("<BR>") Response.Write(Err.Description) Response.End() End Try
now , because I need to connect to oracle alot , can add something to my web.config , instead of using that code to connect to oracle?
What's your advise


Reply With Quote
