Konek
Konek
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.Data.OleDb;
namespace koneksicsharp
{
public partial class Form1 : Form
{
OleDbConnection KoneksiDB;
string Conn;
public Form1()
{
InitializeComponent();
Conn = "provider=microsoft.ACE.OLEDB.12.0;Data
Source=|datadirectory|/Penjualan.accdb";
KoneksiDB = new OleDbConnection(Conn);
KoneksiDB.Open();
}
}
catch (OleDbException salah)
{
MessageBox.Show(salah.ToString());
}
}
while (reader.Read())
{
}
reader.Close();
}
catch (Exception ex)
{
MessageBox.Show("Terjadi kesalahan saat mengisi ComboBox: " +
ex.Message);
}
}
}
}