G
Guest
I use SqlHelper.Execute Scalar a lot in my apps. I need now to use it with
SqlTransactions.
ie: I am currently using code from your:
// Microsoft Data Access Application Block for .NET
// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp
//
// SQLHelper.cs
//
// This file contains the implementations of the SqlHelper and
SqlHelperParameterCache
// classes.
I use the ExecuteScalar lots with stored procedures which I rely on the
Derive Parameters feature (SqlCommandBuilder.DeriveParameters(cmd) in
DiscoverSpParameterSet method in SqlHelperParameterCache.
The SqlHelper.ExecuteScalar and other methods which take SqlTransactions
parameters require the SqlParameters[] to be specifically passed in. The
SqlCommandBuilder.DeriveParameters(cmd) doesn't seem to function within an
SqlTransaction. Maintaining the sql parameters in C# code in addition to the
stored procedures is a lot of ongoing work.
I need to use transactions but I would really like to have my Data Layer
derive the parameters.
Is there a workaround or perhaps another version of the SqlHelper which
allows deriving parameters from stored procedures which inside an
SqlTransaction?
- Marcel
Peak Performance Software Corp.
SqlTransactions.
ie: I am currently using code from your:
// Microsoft Data Access Application Block for .NET
// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp
//
// SQLHelper.cs
//
// This file contains the implementations of the SqlHelper and
SqlHelperParameterCache
// classes.
I use the ExecuteScalar lots with stored procedures which I rely on the
Derive Parameters feature (SqlCommandBuilder.DeriveParameters(cmd) in
DiscoverSpParameterSet method in SqlHelperParameterCache.
The SqlHelper.ExecuteScalar and other methods which take SqlTransactions
parameters require the SqlParameters[] to be specifically passed in. The
SqlCommandBuilder.DeriveParameters(cmd) doesn't seem to function within an
SqlTransaction. Maintaining the sql parameters in C# code in addition to the
stored procedures is a lot of ongoing work.
I need to use transactions but I would really like to have my Data Layer
derive the parameters.
Is there a workaround or perhaps another version of the SqlHelper which
allows deriving parameters from stored procedures which inside an
SqlTransaction?
- Marcel
Peak Performance Software Corp.