Hi guys,
I am working on a small project in C# and MySql. The part of code below is not bringing out the report. I am using Microsoft reportviewer. What could be wrong?
private void detailedToolStripMenuItem_Click(object sender, EventArgs e)
{
DataTable dadt = new DataTable();
MySqlDataAdapter dad = new MySqlDataAdapter();
dad = new MySqlDataAdapter("select staff.companyname,concat(firstname,' ',lastname,' ',surname)as staffname,loan.staffnumber,loannumber,SUBSTR(loan.STARTDATE,1,10)as startdate,concat(paymonth,' ',payyear)as payperiod,adddate(loan.startdate,interval repaymentperiod month) as duedate,loan.interestrate,loan.interestamount,loan.loanbalance,(principalamount+interestamount) as totalamount,loan as amount from staff,loan,salarytransactions where staff.staffnumber=salarytransactions.staffnumber and salarytransactions.staffnumber=loan.staffnumber", cn);
MySqlCommandBuilder mbuilder = new MySqlCommandBuilder(dad);
dadt = new DataTable();
dad.Fill(dadt);
reportFunction("Payroll.Loanstatement.rdlc", "companyloan_DataTable1", dadt);
}