f_naderi
پنج شنبه 05 شهریور 1388, 03:48 صبح
سلام من برنامه ای با سی شارپ نوشتم و در آن می خوام از کریستال ریپورت استفاده کنم ، برنامه من 2 تا فرم داره که کد مشتری را از فرم یک می گیره و به فرم 2 ارسال می کنه، من چنین کدی نوشتم
int code = Convert.ToInt32(common.f);
ds1.Tables.Clear();
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; مکان بانک");
string strsql = "select moshtari.codemoshtari,moshtari.name,bedehkari,sefa resh.shomarehsefaresh,kala.name,forosh.date,sefare sh.tedadkala from sefaresh,moshtari,kala,forosh where kala.codekala=sefaresh.codekala and sefaresh.shomarehsefaresh=forosh.shomarehsefaresh and forosh.codemoshtari=moshtari.codemoshtar and moshtari.codemoshtari=" + code + " group by sefaresh.shomarehsefaresh";
da1 = new OleDbDataAdapter(strsql, con);
da1.Fill(ds1);
con.Close();
CrystalReport1 rpt = new CrystalReport1();
crystalReportViewer1.ReportSource = ds1;
برنامه چنین اروری می ده You tried to execute a query that does not include the specified expression 'codemoshtari' as part of an aggregate function.، مشکل از کجاست؟
int code = Convert.ToInt32(common.f);
ds1.Tables.Clear();
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; مکان بانک");
string strsql = "select moshtari.codemoshtari,moshtari.name,bedehkari,sefa resh.shomarehsefaresh,kala.name,forosh.date,sefare sh.tedadkala from sefaresh,moshtari,kala,forosh where kala.codekala=sefaresh.codekala and sefaresh.shomarehsefaresh=forosh.shomarehsefaresh and forosh.codemoshtari=moshtari.codemoshtar and moshtari.codemoshtari=" + code + " group by sefaresh.shomarehsefaresh";
da1 = new OleDbDataAdapter(strsql, con);
da1.Fill(ds1);
con.Close();
CrystalReport1 rpt = new CrystalReport1();
crystalReportViewer1.ReportSource = ds1;
برنامه چنین اروری می ده You tried to execute a query that does not include the specified expression 'codemoshtari' as part of an aggregate function.، مشکل از کجاست؟