Mail Merge in Cache Database

G

Guest

Hi,

I'm trying to do mail merge to word document where the data source is from a
database called "Cache" from intersystems using this code:

public CacheConnection cnCache;
string cacheConnectString =
ConfigurationManager.AppSettings["CacheConnectionString"];

cnCache = new CacheConnection(cacheConnectString);
cnCache.Open();
Object oConnection = cnCache;
Object oQuery = "SELECT GivenNames,Surname from cvPeople.People WHERE ID=1";

Object oSubType = Word.WdMergeSubType.wdMergeSubTypeWord;

//Open the data source and merge the fields

wrdMailMerge.OpenDataSource("", ref oFileFormat, ref oMissing, ref oMissing,
ref oTrue, ref oMissing,ref oMissing, ref oMissing, ref oFalse, ref oMissing,
ref oMissing, ref oConnection, ref oQuery, ref oMissing, ref oMissing, ref
oSubType);

But it doesn't work !!? because "oConnection" should be the DNS connection
and I don't know how to do it in Cache!
does some body knows how to do it? or if not does any one how to use a Data
Set as the data source, because I know how to fill a DataSet from Cache and
from there I could just use the DataSet to mege the Document.


Thks
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top