Hi,
You can run a custom query if you first create it either manually in the CMS_Query table or through the administration interface. Here is an example:
using CMS.DataEngine;
...
GeneralConnection cn = ConnectionHelper.GetConnection();
DataSet ds = null;
object[,] parameters = new object[1, 3];
parameters[0, 0] = "@UserName";
parameters[0, 1] = "johns";
ds = cn.ExecuteQuery("cms.user.selectbyname", parameters);
Best regards,
Ivana Tomanickova