Hi,
I have implemented my async database operation in following way. Now I need to implement the same in LLBLGEN ActionProcedures asynchronously. Is this possible to implement it?
public static void BeginDataBaseCall(int dataSetId, int entityId, int reportingPeriod, int taxid,
int transId, string statementDt, int level)
{
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString);
SqlCommand command = new SqlCommand("ApplyTrans", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@TaxId", taxid);
command.Parameters.AddWithValue("@TransID", transId);
command.Parameters.AddWithValue("@EntityId", entityId);
command.Parameters.AddWithValue("@ReportingPeriod", reportingPeriod);
command.Parameters.AddWithValue("@datasetId", dataSetId);
command.Parameters.AddWithValue("@StatementDt", statementDt);
command.Parameters.AddWithValue("@level", level);
connection.Open();
command.BeginExecuteNonQuery(EndDatabaseCall, command);
}
public static void EndDatabaseCall(IAsyncResult result)
{
SqlCommand command = result.AsyncState as SqlCommand;
try
{
int reader = command.EndExecuteNonQuery(result);
}
catch
{
throw;
}
finally
{
#region Cleanup
command.Connection.Close();
command.Connection.Dispose();
command.Dispose();
#endregion
}
}
Thanks,