using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Devart.Data.Oracle; //using Oracle.DataAccess.Client; namespace IBT_Windows_Emulator { public partial class Form1 : Form { public Form1() { InitializeComponent(); } OracleConnection con; OracleCommand cmd; OracleDataReader dr; private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { try { OracleConnectionStringBuilder oraCSB = new OracleConnectionStringBuilder(); //oraCSB.Direct = true; oraCSB.Server = "***.**.**.51"; oraCSB.Port = 1521; oraCSB.Sid = "***"; oraCSB.UserId = "*****"; oraCSB.Password = "*****"; con = new OracleConnection(oraCSB.ConnectionString); con.Open(); string str = "select distinct store_name3 from store"; cmd = new OracleCommand(str, con); dr = cmd.ExecuteReader(); if (dr.HasRows) { comboBox1.Items.Clear(); while (dr.Read()) { comboBox1.Items.Add(dr[0].ToString()); } MessageBox.Show("Added"); } } catch (Exception ex) { MessageBox.Show(ex.Message, "error"); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)