crystal report problem
-
i have made report of 115 query and it's working well but the problem here is the report is tooooooo slow what can i do please help
the reason its taking so long to work is that you are doing 115 INDIVIDUAL queries... thats 115 new connections to a server and 115 questions of the server.... thats a LOT of data.... Consider using a BackroundWorker of some kind, OR using a berrer query structure... thats why its taking so long. to make it simpler, think of a query as a conversation. You make a query to a server, you start a whole NEW converstion with it. you ask one question ( ie select all from * where foo equals bar) you end the conversation. repeat 115 times. better way to do it: connect to server. ask it "select from * where ( foo = bar) OR (baz = bar) OR ...." parse that data. end connection. no repeat. you only have to understand the data that you are being fed. but the only thing you have to do once is ask the query... not 115 times because you've asked it a really well refined question that can easily be answered. Hope that helps.
---- Morgan Gangwere Lead programmer, Unknown Software "Pinky, are you thinking what im thinking?" "I Dunno brain, how many licks DOES it take to get to the tootsie roll center of a tootsie pop?" "You want me to calculate that? or should we take over the world?" "ooh! OooooOOOooH! lets find out!"
-
the reason its taking so long to work is that you are doing 115 INDIVIDUAL queries... thats 115 new connections to a server and 115 questions of the server.... thats a LOT of data.... Consider using a BackroundWorker of some kind, OR using a berrer query structure... thats why its taking so long. to make it simpler, think of a query as a conversation. You make a query to a server, you start a whole NEW converstion with it. you ask one question ( ie select all from * where foo equals bar) you end the conversation. repeat 115 times. better way to do it: connect to server. ask it "select from * where ( foo = bar) OR (baz = bar) OR ...." parse that data. end connection. no repeat. you only have to understand the data that you are being fed. but the only thing you have to do once is ask the query... not 115 times because you've asked it a really well refined question that can easily be answered. Hope that helps.
---- Morgan Gangwere Lead programmer, Unknown Software "Pinky, are you thinking what im thinking?" "I Dunno brain, how many licks DOES it take to get to the tootsie roll center of a tootsie pop?" "You want me to calculate that? or should we take over the world?" "ooh! OooooOOOooH! lets find out!"
thanks so much for ur help but iam beginner so i would like to see an example because i can't get all ur reply any way i will give one of my sql statement but u have to know that each sql statement is different from the other here is the example
Dim s As String Call conn() '''''''''''''''''''''''''''' s = "drop view sanad1" cmd.CommandText = s dr = cmd.ExecuteReader() dr.Close() ''''''''''''''''''''''''''''''''''''''' s = "create view sanad1 as select number from sanad where number = '" + TextBox97.Text + "' " cmd.CommandText = s dr = cmd.ExecuteReader dr.Close() s = 0 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Call conn() '''''''''''''''''''''''''''' s = "drop view sanad2" cmd.CommandText = s dr = cmd.ExecuteReader() dr.Close() ''''''''''''''''''''''''''''''''''''''' s = "create view sanad2 as select topic from sanad where number = '" + TextBox97.Text + "' " cmd.CommandText = s dr = cmd.ExecuteReader dr.Close() s = 0
so please tell me what should i do practicaly thanks so much