Click here to Skip to main content
12,067,652 members (28,165 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: SQL-Server ASP.NET4
Hi,

I want to perform multiple sql query with loop and i want these queries perform with some time interval.
SqlConnection sqlconn = new SqlConnection(str);
            sqlconn.Open();
            string strquery;
            strquery = "SELECT Indices_id, IndicesName, LastPrice, ChangePrice * .63 AS 'change of price', Percentage FROM Table1";
            strquery2 = "SELECT Indices_id, IndicesName, LastPrice, ChangePrice * .60 AS 'change of price', Percentage FROM Table1";
            strquery3 = "SELECT Indices_id, IndicesName, LastPrice, ChangePrice * -.60 AS 'change of price', Percentage FROM Table1";
            SqlCommand sqlcmd = new SqlCommand(strquery, sqlconn);
            DataSet ds = new DataSet();
            SqlDataAdapter sda = new SqlDataAdapter();
            sda.SelectCommand = sqlcmd;
            sda.Fill(ds);
            GridView1.DataSource = ds;
            GridView1.DataBind();
Posted 6-Nov-12 5:51am
Edited 6-Nov-12 5:58am
RaisKazi34.1K
v2
Comments
OriginalGriff 6-Nov-12 12:11pm
   
And? Your problem is?
Sandeep Mewara 6-Nov-12 17:47pm
   
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
damodara naidu betha 7-Nov-12 0:22am
   
you need to get execution time also?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

try using parallel for loop for this.

here is an eg. of this. you will have much control on each of these SQL queries.

http://msdn.microsoft.com/en-us/library/dd460713.aspx[^]
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100