sql query way tiring for sync()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zonar00
    New Member
    • Oct 2007
    • 16

    sql query way tiring for sync()

    I wanna help on the following aspect of SQL data retrieval which requires one to retrieve data from remote SQL server site asynchronously.

    Im building a c# application. I want to retrieve record (network packets info) from the remote computer that is located on the same subnet as the client (from which it receives the request). Since due to the large volume of data which may include more than 20,000 rows in each table .....

    Code:
    void results()
            {
             
                dataGridView1.DataSource = null;
    
               
              
                DataSet ds = new DataSet();
                
               
                SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM " + state, rc);
    
    	     // where rc is the SQL connection point that exists b/w my sql client and SQL server (remote machine) meaning the connection is already established when i execute the command
                
              
                adapter.Fill(ds);
                dataGridView1.DataSource = ds.Tables[0];
            
            }
    Its simply too slow for comfort and more importantly this function halts the execution of more user controlled events like clicking other buttons and moving cursor. The whole control
    on the panel is lost during the sql command execution and its bloody annoying :).

    So does anyone know how could i make fun() behave asynchronously.

    thxs.....
Working...