M
Martin Eyles
I have an ASP page that makes a vml/svg graph out of data. In order to
extract all the necessary data I have to perform 68 SQL queries, which is
unfortunatley a bit slow at the moment.
For each of the procedures I go through code of this form
Dim conn As New SqlClient.SqlConnection("Data Source=" & ServerName & ";
User ID=***; Password=***")
conn.Open()
SQL = "" 'in operation has code to dynamically construct one of the
queries.
Dim command As New SqlClient.SqlCommand(SQL, conn)
Dim r As SqlClient.SqlDataReader
r = command.ExecuteReader
While r.Read
'Code here to extract data and plot one section of the graph
End While
r.Close()
conn.Close()
Is there anything I am doing here that would make the code slower. For
instance, can I share one connection, and with this speed things up? Is
there a way to keep the same command object and keep changing the SQL? would
this be any faster? Any other ideas on how to speed this up?
Thanks,
Martin
extract all the necessary data I have to perform 68 SQL queries, which is
unfortunatley a bit slow at the moment.
For each of the procedures I go through code of this form
Dim conn As New SqlClient.SqlConnection("Data Source=" & ServerName & ";
User ID=***; Password=***")
conn.Open()
SQL = "" 'in operation has code to dynamically construct one of the
queries.
Dim command As New SqlClient.SqlCommand(SQL, conn)
Dim r As SqlClient.SqlDataReader
r = command.ExecuteReader
While r.Read
'Code here to extract data and plot one section of the graph
End While
r.Close()
conn.Close()
Is there anything I am doing here that would make the code slower. For
instance, can I share one connection, and with this speed things up? Is
there a way to keep the same command object and keep changing the SQL? would
this be any faster? Any other ideas on how to speed this up?
Thanks,
Martin