Hello,
I searched the forum and possible articles. I read all articles but actually I understand nothing. I still dont know how to connect.
1. Is this possible to connect a oracle db, without installing a program? (Like Oracle Data Provider for .NET)
But, I installed "ODAC 11.2 Release 3 and Oracle Developer Tools for Visual Studio (11.2.0.2.1)" from Oracle web side. Then accordinf this article --> http://www.c-sharpcorner.com/UploadFile/nipuntomar/4749/
I want to add;
using Oracle.DataAccess.Client;
line to my code but VS is not recognize this line.
Actually I couldnt find an article that explaining step by step.
Simply, How can I do that? Is this possible to connect only a single connection string?
Loading
Guest UserPosted Jun 13, 2011, 8:56 AM
When you installed the Oracle Developer Tools, it should have created a folder on your hard drive with all of the necessary files. Buried within that folder is a subfolder called "odp.net". Within that folder is a "bin" folder, and in bin there are 2 folders "2.x" and "4". Each one of those contains a file "Oracle.DataAccess.dll". You need to add a reference to the one that corresponds to the version of .Net you're using (if you're using 4.0 then reference the dll in the "4" folder, otherwise use the one in the "2.x" folder).
Do you know how to add a reference to a project in VS?
Suthish NairPosted Jun 14, 2011, 5:48 AM
Find Database Connection and Generate Connection String using Visual Studio
yokzuPosted Jun 14, 2011, 3:04 AM
Guest UserPosted Jun 13, 2011, 9:20 AM
yokzuPosted Jun 13, 2011, 9:08 AM
I just download and and instaled from this link ---> http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
I think you have mentioning this link ---> http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
Now I am donwnloading.
Yes I know how to reference .dll files to project.
After I'll install "ODAC 11.2 Release 3" I'll let you know.
But I am curious about this, is this the only way? Isnt there any other way to connect to DB without installing programs from Oracle?
yokzuPosted Jun 13, 2011, 8:53 AM
yokzuPosted Jun 13, 2011, 8:50 AM
Mayur GujrathiPosted Jun 13, 2011, 8:47 AM
This will test the connection of oracle database
private void button1_Click(object sender, EventArgs e)
{
oracon = new OleDbConnection("Provider=Msdaora;User Id=Scott;Password=tiger");
oracon.Open();
MessageBox.Show(oracon.State.ToString());
oracon.Close();
MessageBox.Show(oracon.State.ToString());
}
this will test the connection of sql server database
private void button2_Click(object sender, EventArgs e)
{
sqlcon = new OleDbConnection();
sqlcon.ConnectionString = "Provider=SQLOLEDB;User Id=citrus_usr;Password=surtic;Database=DEMAT;Data Source=server";
sqlcon.Open();
MessageBox.Show(sqlcon.State.ToString());
sqlcon.Close();
MessageBox.Show(sqlcon.State.ToString());
}
Guest UserPosted Jun 13, 2011, 8:46 AM
You don't need to specify anything in tnsnames.ora, instead you can place all required parameters on the connection string like this:
EDIT: note that not all of the parameters I specified above may apply to your configuration, but hopefully my example is enough to get you going in the right direction.
yokzuPosted Jun 13, 2011, 8:18 AM
-----
NRM_PROD=
(DESCRIPTION=
(LOAD_BALANCE=yes)
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=99.99.27.30)
(PORT=1521)
)
(ADDRESS=
(PROTOCOL=TCP)
(HOST=99.99.27.31)
(PORT=1521)
)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=TELLRA.company.com)
)
)
--------
How should I write these informations into connection string?
yokzuPosted Jun 13, 2011, 8:15 AM
In the paper, guys said just "Instead of using OLEDB Provider, use the Oracle Provider. ".. I know I should use Oracle Provider, how?? He didnt write anything and it isnt help me.
Please give me a specific link or string?
Posted Jun 13, 2011, 7:57 AM
http://webdesign.ittoolbox.com/groups/technical-functional/asp-dotnet-l/how-to-connect-oracle-database-in-aspnet-2005-c-using-oledb-provider-1705513
string strCon = string.Empty;
string strCmdText = string.Empty;
DataSet ObjDS = new DataSet();
// strCon = "Provider=SQLOLEDB;server=MAHESH\\MAHESH;database=E CF;uid=sa;pwd=sa;";
strCon = "Data Source=KMS;User Id=system;Password=tiger;";
OracleConnection ObjCon = new OracleConnection(strCon);
ObjCon.Open();
strCmdText = "select top 20 Users_Salutation,Users_FirstName,Users_MiddleName, Users_LastName from Users";
OracleCommand ObjSQLCom = new OracleCommand(strCmdText, ObjCon);
OracleDataAdapter ObjSQLDA = new OracleDataAdapter(ObjSQLCom);
ObjSQLDA.Fill(ObjDS);
ObjCon.Close();
yokzuPosted Jun 13, 2011, 7:50 AM