Writing Custom DAL over Profile Subsytem
I am planning to write custom DAL over commerce server profile susbsystem due to the following limitations in the commerce server profile system API.
1) Commerce server profile API does not support transactions.
2) I want to execute custom stored procedures in profile subsystem.
3) I want to exceute complex sql queries involving "and" / "or" operators.
For this, I am using the following code.
//Microsoft.CommerceServer.Runtime.Configuration.CommerceResourceCollection resources =newCommerceResourceCollection("StarterSite");CommerceResource profilesResource = resources["Biz Data Service"];string bizdataConnstr = profilesResource["s_BizDataStoreConnectionString"].ToString();OleDbConnection conn =newOleDbConnection(bizdataConnstr);try{
conn.Open();
try{
DataSet result =newDataSet();OleDbCommand command =newOleDbCommand("sp_custom", conn);command.CommandType =
CommandType.StoredProcedure;OleDbDataAdapter da =newOleDbDataAdapter(command);da.Fill(result);
}
catch (Exception exp){
//Log}
}
finally{
if(conn.State==ConnectionState.Open)conn.Close();
}
Please comment whether this way of writing custom DAL is correct in my scenario.

