Page 1 of 1

Custom SQL On Gold R6

Posted: Thu Nov 13, 2014 10:44 am
by LoganTheWebDev
Was wondering how/if there was a way to do custom SQL commands in Gold R6? I found http://wiki.ablecommerce.com/index.php/ ... ries_-_AC7 which tells how to do it for AC7, but it doesn't seem to work for our version. Any help would be greatly appreciated!

Re: Custom SQL On Gold R6

Posted: Thu Nov 13, 2014 2:51 pm
by jguengerich
There's at least 2 options, I'll call them the "NHibernate way" or the ".NET SQL client" way.

Here's a little info on the first: viewtopic.php?f=65&t=17153. You'll need (at least) "using CommerceBuilder.DomainModel;".

For the second, you can get the connection string and set up a connection like this:

Code: Select all

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["AbleCommerce"].ConnectionString);
You'll need "using System.Data.SqlClient;" and "using CommerceBuilder.Utility;" and/or "using CommerceBuilder.Common;"