problem in oracle database connection string

W

wfairl

Well you haven't explained the problem but I will tell you that you
don't need the server attribute in an oracle connection string. Just
make sure the DataSource attribute is a valid SID alias from either
your TNSNames.ora file or your Oracle NameServer.
 
N

noor

Hi, I'm trying to connect to my Oracle 10g Database

i m facing the problem of connection string, following code is that i use,
please tell me how to use the connection string for accessing the oracle
database from a remote location and from local machine, at both places i m
getting the problem. tell me how to set the server name, data sourse of a
remote server to acces tha data from a client on a diffrent machine.
I used this code:

protected Oracle.DataAccess.Client.OracleConnection con;

protected Oracle.DataAccess.Client.OracleCommand orcmd;

protected Oracle.DataAccess.Client.OracleDataReader orcreader;


private void Page_Load(object sender, System.EventArgs e)

{

string cmdQuery = "SELECT COMPANY_ID, COMPANY_Name FROM COMPANY_LIST_TEMP";

con.ConnectionString="Server=Sct-hasan;User Id=sys;Password=sa;Data
Source=TADB;";
orcmd= new Oracle.DataAccess.Client.OracleCommand(cmdQuery);

con.Open();

orcmd.Connection= con;

orcmd.CommandType=CommandType.Text;

orcreader= orcmd.ExecuteReader();

con.Close();



}

..................................................

thanx .bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top