How to connect to an Oracle 11g database using Asp.Net

How to connect to Oracle 11g database using asp.net3.5?

what is the namespace and how to write the connection string in the web.config file?

Please help me..

+4
source share
1 answer

It depends on the data provider. See: ConnectionString.com And, perhaps more specifically: The .NET Data Provider for Oracle . The connection string should look very similar in your web.config file. The only differences are likely to be the system name / db, user id, pwd, etc.

Namespaces :

you need to know which type of objects can have the same name and which do not. To do this, you need to introduce the concept of a namespace. A namespace defines a group of object types within which all names must be uniquely identified by a schema and name. Objects in different namespaces have the same name.

Here is also a good tutorial that you can track that is specific to ASP.NET. And another article that might be of interest.

And a piece of code (using the Oracle .NET provider :)

public DataTable myDataTable(string SQL, string ConnStr) { OracleConnection cn = default(OracleConnection); DataSet dsTemp = null; OracleDataAdapter dsCmd = default(OracleDataAdapter); cn = new OracleConnection(ConnStr); cn.Open(); dsCmd = new OracleDataAdapter(SQL, cn); dsTemp = new DataSet(); dsCmd.Fill(dsTemp, "myQuery"); cn.Close(); return dsTemp.Tables[0]; } 
+2
source

Source: https://habr.com/ru/post/1332451/


All Articles