Click here to Skip to main content
15,923,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone....

the correct data us comming to the crystal report. but in the report the data is incorrect.

what will be the wrong im doing here??
SqlConnection conn = new SqlConnection(ConnectionString);
SqlCommand command = new SqlCommand();


String S4 = " select Period.Per,Account.Acc,GL.Deb,GL.Cre from Period,Account,GL where GL.Period=Period.Per and Account.AccLink=GL.AccLink and Month(Per) = '" + combo_Month.SelectedItem.ToString().Trim() + "' and Year(PerDate) ='" + combo_Year.SelectedItem.ToString().Trim() + "'";
SqlDataAdapter da4 = new SqlDataAdapter(S4, ConnectionString);
da4.Fill(a, "Dt_Tb_2");

String S6 = "select Period.Per from Period where Month(Date) = '" + combo_Month.SelectedItem.ToString().Trim() + "' and Year(Date) ='" + combo_Year.SelectedItem.ToString().Trim() + "'";
SqlDataAdapter da6 = new SqlDataAdapter(S6, ConnectionString);
DataTable dt = new DataTable();
da6.Fill(dt);

String S5 = "select Period.Date,Account.Acc,SUM(GL.Deb),SUM(GL.Cred) from Period,Account,GL where GL.Period=Period.Per and Account.AccLink=PostGL.AccLink and Per<='" + dt.Rows[0].ItemArray[0] + "' group by Period.Date,Account.Account";
SqlDataAdapter da5 = new SqlDataAdapter(S5, ConnectionString);
da5.Fill(a, "Dt_Tb_3");

frmTBViwer tb = new frmTBViwer(this);
tb.Show();
Posted

1 solution

How are da4, da6, and da5 related to frmTBViwer ? Why are all your variable names so unreadable ? How do you know the data is correct ? How is the data that is shown different from the correct data ?

Pls. edit your post to provide these details.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900