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;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportSource;
namespace ProjectV2._0
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Peerakit\Desktop\FOLDER PROJECT\DEMO\ProjectV2.0\ProjectV2.0\ManageSystemDB.accdb");
private void button1_Click(object sender, EventArgs e)
{
con.Open();
OleDbCommand cm = con.CreateCommand();
cm.CommandType = CommandType.Text;
cm.CommandText = "select * from login";
cm.ExecuteNonQuery();
OleDbDataAdapter adap = new OleDbDataAdapter(cm);
dataset01 ds = new dataset01();
adap.Fill(ds, "login");
CrystalReport3 cr = new CrystalReport3();
cr.SetDataSource(ds);
crystalReportViewer1.ReportSource = cr;
con.Close();
}
}
}