src/openSourceC.DotNetLibrary.Data.SqlClient/Data/SqlClient/SqlDbCommand.cs
/// <summary>
///		Initiates the asynchronous execution of the Transact-SQL statement or stored
///		procedure that is described by this <see cref="T:SqlCommand"/>, using one of the
///		<see cref="T:CommandBehavior"/> values, and retrieving one or more result sets from
///		the server, given a callback procedure and state information.
/// </summary>
/// <param name="callback">An <see cref="T:AsyncCallback"/> delegate that is invoked when
///		the command's execution has completed. Pass <b>null</b> (<b>Nothing</b> in Microsoft
///		Visual Basic) to indicate that no callback is required.</param>
/// <param name="stateObject">A user-defined state object that is passed to the callback
///		procedure. Retrieve this object from within the callback procedure using the
///		<see cref="P:AsyncState"/> property.</param>
/// <param name="behavior">One of the <see cref="T:CommandBehavior"/> values, indicating
///		options for statement execution and data retrieval.</param>
/// <returns>
///		An <see cref="T:IAsyncResult"/> that can be used to poll or wait for results, or
///		both; this value is also needed when invoking <see cref="T:EndExecuteReader"/>,
///		which returns a <see cref="T:SqlDataReader"/> instance which can be used to retrieve
///		the returned rows.
/// </returns>
Initiates the asynchronous execution of the Transact-SQL statement or stored
procedure that is described by this , using one of the
values, and retrieving one or more result sets from
the server, given a callback procedure and state information.
Initiates the asynchronous execution of the Transact - SQL statement or stored procedure that is described by this using one of the values and retrieving one or more result sets from the server given a callback procedure and state information .
[HostProtection(SecurityAction.LinkDemand, ExternalThreading = true)]
		public IAsyncResult BeginExecuteReader(AsyncCallback callback, object stateObject, CommandBehavior behavior)
		{
			bool isClosed = (Command.Connection.State == ConnectionState.Closed);
			if (isClosed)
			{
				Command.Connection.Open();
			}
			EnsureTransaction();
			try
			{
				if (AutoPrepare)
				{
					Command.Prepare();
				}
				return Command.BeginExecuteReader(callback, stateObject, behavior);
			}
			finally
			{
				if (isClosed)
				{
				}
			}
		}
[ HostProtection ( SecurityAction . LinkDemand , ExternalThreading = true ) ] public IAsyncResult BeginExecuteReader ( AsyncCallback callback , object stateObject , CommandBehavior behavior ) { bool isClosed = ( Command . Connection . State == ConnectionState . Closed ) ; if ( isClosed ) { Command . Connection . Open ( ) ; } EnsureTransaction ( ) ; try { if ( AutoPrepare ) { Command . Prepare ( ) ; } return Command . BeginExecuteReader ( callback , stateObject , behavior ) ; } finally { if ( isClosed ) { } } }
Initiates the asynchronous execution of the Transact-SQL statement or stored
procedure that is described by this , using one of the
values, and retrieving one or more result sets from
the server, given a callback procedure and state information.
Initiates the asynchronous execution of the Transact - SQL statement or stored procedure that is described by this using one of the values and retrieving one or more result sets from the server given a callback procedure and state information .
//_cmd.Connection.Close();
An  that can be used to poll or wait for results, or
both; this value is also needed when invoking ,
which returns a  instance which can be used to retrieve
the returned rows.
An that can be used to poll or wait for results or both ; this value is also needed when invoking which returns a instance which can be used to retrieve the returned rows .
callback
AsyncCallback
An  delegate that is invoked when
the command's execution has completed. Pass nullNothing
An delegate that is invoked when the command ' s execution has completed . Pass nullNothing
stateObject
object
A user-defined state object that is passed to the callback
procedure. Retrieve this object from within the callback procedure using the
property.
A user - defined state object that is passed to the callback procedure . Retrieve this object from within the callback procedure using the property .
behavior
CommandBehavior
One of the  values, indicating
options for statement execution and data retrieval.
One of the values indicating options for statement execution and data retrieval .