This is what I attempted... I thought I was doing that but apparently not. I believe I got the start of this from a post from you a few years ago too. I varied from it since I wanted to capture the data into a recordset and use that to loop through and send back to my form. It fails on the OleConnection.Open(); portion.
AdoQueryConnection connection =
(AdoQueryConnection)DataConnections["AD_Mirror"];
string customQuery = " where SamAccountName = '" + userName + "'";
string queryString = origCommand + customQuery;
DataSet oSet = new DataSet();
// connection.Execute(); //Is this Needed?
string conn = connection.Connection;
// SqlDataAdapter adapter = new SqlDataAdapter(queryString, conn);
using (OleDbConnection OleConnection = new OleDbConnection(conn))
{
OleDbCommand command = new OleDbCommand(queryString, OleConnection);
command.CommandType = CommandType.Text;
try
{
OleConnection.Open();