hi everyone....
tto my dataset it filling the correct records. but its not comming to the crystal report. means the records in crystal report is incorrect. in cryatal report all the recordes in database is coming not the given period.
what will be the wrong im doing here??
<code>
SqlConnection conn = new SqlConnection(C onnectionString );
SqlCommand command = new SqlCommand();
String S4 = " select Period.Per,Acco unt.Acc,GL.Deb, GL.Cre from Period,Account, GL where GL.Period=Perio d.Per and Account.AccLink =GL.AccLink and Month(Per) = '" + combo_Month.Sel ectedItem.ToStr ing().Trim() + "' and Year(PerDate) ='" + combo_Year.Sele ctedItem.ToStri ng().Trim() + "'";
SqlDataAdapter da4 = new SqlDataAdapter( S4, ConnectionStrin g);
da4.Fill(a, "Dt_Tb_2");
String S6 = "select Period.Per from Period where Month(Date) = '" + combo_Month.Sel ectedItem.ToStr ing().Trim() + "' and Year(Date) ='" + combo_Year.Sele ctedItem.ToStri ng().Trim() + "'";
SqlDataAdapter da6 = new SqlDataAdapter( S6, ConnectionStrin g);
DataTable dt = new DataTable();
da6.Fill(dt);
String S5 = "select Period.Date,Acc ount.Acc,SUM(GL .Deb),SUM(GL.Cr ed) from Period,Account, GL where GL.Period=Perio d.Per and Account.AccLink =PostGL.AccLink and Per<='" + dt.Rows[0].ItemArray[0] + "' group by Period.Date,Acc ount.Account";
SqlDataAdapter da5 = new SqlDataAdapter( S5, ConnectionStrin g);
da5.Fill(a, "Dt_Tb_3");
frmTBViwer tb = new frmTBViwer(this );
tb.Show();
</code>
tto my dataset it filling the correct records. but its not comming to the crystal report. means the records in crystal report is incorrect. in cryatal report all the recordes in database is coming not the given period.
what will be the wrong im doing here??
<code>
SqlConnection conn = new SqlConnection(C onnectionString );
SqlCommand command = new SqlCommand();
String S4 = " select Period.Per,Acco unt.Acc,GL.Deb, GL.Cre from Period,Account, GL where GL.Period=Perio d.Per and Account.AccLink =GL.AccLink and Month(Per) = '" + combo_Month.Sel ectedItem.ToStr ing().Trim() + "' and Year(PerDate) ='" + combo_Year.Sele ctedItem.ToStri ng().Trim() + "'";
SqlDataAdapter da4 = new SqlDataAdapter( S4, ConnectionStrin g);
da4.Fill(a, "Dt_Tb_2");
String S6 = "select Period.Per from Period where Month(Date) = '" + combo_Month.Sel ectedItem.ToStr ing().Trim() + "' and Year(Date) ='" + combo_Year.Sele ctedItem.ToStri ng().Trim() + "'";
SqlDataAdapter da6 = new SqlDataAdapter( S6, ConnectionStrin g);
DataTable dt = new DataTable();
da6.Fill(dt);
String S5 = "select Period.Date,Acc ount.Acc,SUM(GL .Deb),SUM(GL.Cr ed) from Period,Account, GL where GL.Period=Perio d.Per and Account.AccLink =PostGL.AccLink and Per<='" + dt.Rows[0].ItemArray[0] + "' group by Period.Date,Acc ount.Account";
SqlDataAdapter da5 = new SqlDataAdapter( S5, ConnectionStrin g);
da5.Fill(a, "Dt_Tb_3");
frmTBViwer tb = new frmTBViwer(this );
tb.Show();
</code>