Query data from Oracle

using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Collections;
using System.Data.OleDb;

string connectionString = @"Provider=MSDAORA.1;user id=username;
password=mypass; data source=" +

"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)" +
"(HOST=IPADDRESS)(PORT=1521))(CONNECT_DATA=" +
"(SERVICE_NAME=servicename)))";

OleDbConnection con = new OleDbConnection(connectionString);

con.Open();
OleDbDataAdapter adapter = new OleDbDataAdapter("select * from table_data", con);
DataSet set = new DataSet();
adapter.Fill(set);

Comments

Popular posts from this blog

Sử dụng Redshift để chỉnh màu laptop