hello,
I am developing a windows application with access database
and want to use crystal report for making reports.I am able to fetch data in data grid view by using BINDING SOURCE like this.
private void filter(string str)
{
string connectionstring = (@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\nic-15\My Documents\ALRS.mdb");
OleDbConnection con = new OleDbConnection(connectionstring);//C:\Documents and Settings\nic-15\Desktop
con.Open();
OleDbDataAdapter da = new OleDbDataAdapter(str, con);
OleDbCommandBuilder cmdbuilder = new OleDbCommandBuilder(da);
DataTable dt = new DataTable();
dt.Locale = System.Globalization.CultureInfo.InvariantCulture;
da.Fill(dt);
bindingSourceViewRecord.DataSource = dt;
// dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
dataGridView1.ReadOnly = true;
dataGridView1.DataSource = bindingSourceViewRecord;
}
private void buttonFilterSearch_Click(object sender, EventArgs e)
{
string str = "select thana,licence_number,sanction_date,renewal_date,licencee_name,father_name,village,type_of_arm,arms_number,valid_area from arms_records where thana='" + comboBoxThana.SelectedItem + "'";
filter(str);
}
This code works properly and so i found BindingSource very easy to use.Now i want to use this binding source to use in crystal report as datasource.
I am developing my first application
Please help.
thank you.