CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of APM
C#
Func<int, int> invoker = ...;
 
var ar = invoker.BeginInvoke(42, ar =>
    {
        //We need to retrieve the delegate and the state:
        AsyncResult realAR = (AsyncResult)ar;
        int typedState = (int)ar.AsyncState;
        var invoker = (Func<int, int>)realAR.AsyncDelegate;
        //End the operation and print the result:
        int result = invoker.EndInvoke(ar);
by bnaya   January 14, 2012 @ 2:15pm
Tags: APM
28 Views
no comments
 
C#
var conn = new SqlConnection(CONN_STR);
var cmd = new SqlCommand("Select * from Employee", conn);
conn.Open();
cmd.BeginExecuteReader(ar =>
    {
        int affected = cmd.EndExecuteNonQuery(ar);
        cmd.Dispose();
        conn.Dispose();
    }, null);
by bnaya   January 14, 2012 @ 2:10pm
Tags: APM, DAL, ADO
37 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate