Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 4:51am
Edited 6-Nov-12 4:58am
RaisKazi32.1K
v2
Comments
OriginalGriff at 6-Nov-12 12:11pm
   
And? Your problem is?
Sandeep Mewara at 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 at 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
0 Sergey Alexandrovich Kryukov 766
1 OriginalGriff 452
2 sanket saxena 329
3 Tadit Dash 310
4 Peter Leow 228
0 Sergey Alexandrovich Kryukov 11,990
1 OriginalGriff 7,349
2 Peter Leow 5,003
3 Abhinav S 4,003
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid