C# ile DataReader Kullanımı için tıklayınız.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace veri_islemleri
{
public partial class dtreader : Form
{
public dtreader()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection(“Provider=Microsoft.ACE.Oledb.12.0;Data Source=ornek.accdb”);
OleDbCommand cmd = new OleDbCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = “SELECT * FROM bilgi”;
OleDbDataReader dr;
dr = cmd.ExecuteReader();
while (dr.Read())
{
comboBox1.Items.Add(dr[“kisiAd”]);
comboBox2.Items.Add(dr[“kisiSoyad”]);
}
conn.Close();
}
}
}