Oracle Developer Tools for Visual Studio 2015 indir http://www.oracle.com/technetwork/developer-tools/visual-studio/overview/index.html
kur ve kodlar
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Oracle.ManagedDataAccess;
using Oracle.ManagedDataAccess.Client;
namespace OracleTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string oradb;
private void Form1_Load(object sender, EventArgs e)
{
//bağlantı
StreamReader sr = new StreamReader("dbConnect.txt");
oradb = sr.ReadLine();
sr.Close();
}
private void button1_Click(object sender, EventArgs e)
{
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
StreamReader sr = new StreamReader("sql1.txt");
string sql1 = sr.ReadLine();
sr.Close();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = sql1;
cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "ss");
gridControl1.DataSource = ds.Tables["ss"];
//OracleDataReader dr = cmd.ExecuteReader();
//dataGridView1.DataSource = dr;
//while (dr.Read())
//{
// listBox1.Items.Add(dr.GetString(2));
//}
//conn.Dispose();
}
}
}
kur ve kodlar
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Oracle.ManagedDataAccess;
using Oracle.ManagedDataAccess.Client;
namespace OracleTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string oradb;
private void Form1_Load(object sender, EventArgs e)
{
//bağlantı
StreamReader sr = new StreamReader("dbConnect.txt");
oradb = sr.ReadLine();
sr.Close();
}
private void button1_Click(object sender, EventArgs e)
{
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
StreamReader sr = new StreamReader("sql1.txt");
string sql1 = sr.ReadLine();
sr.Close();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = sql1;
cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "ss");
gridControl1.DataSource = ds.Tables["ss"];
//OracleDataReader dr = cmd.ExecuteReader();
//dataGridView1.DataSource = dr;
//while (dr.Read())
//{
// listBox1.Items.Add(dr.GetString(2));
//}
//conn.Dispose();
}
}
}
dbconnect.txt
Data Source=ORCL;User Id=hr;Password=hr;