Changing Sql Statement 追蹤

0
Avatar
Legacy Poster

I am new to Bartender using the trial edition. I am trying to evaulate the software to see if its the correct solution for us.
I am using Visual Studio 2010, c#

I need to dynamically create the SQL at print time. I have been looking at examples. All seem to have the following type of code.


BarTender.Application btApp
BarTender.Database btDb;
BarTender.Format btDoc;
btApp = new BarTender.ApplicationClass();
btDoc = btApp.Formats.Open("Labels.btw", false, "");
btDb = btDoc.Databases.GetDatabase(1);

My problem is I do not have any reference to Databases.GetDatabase

I am trying

Engine btEngine = new Engine();
btEngine.Start();
LabelFormatDocument btFormat = btEngine.Documents.Open(LabelFileName);
Seagull.BarTender.Print.Database.OLEDB btDb;

But then I become lost in assigning anything to btDB.


Any help would be greatly appreciated.

2 意見

0
Avatar
Shotaro Ito
評論操作 永久連結

Hi SarahL,
Try this way..
[code]
Seagull.BarTender.Print.Database.OLEDB btdb = new Seagull.BarTender.Print.Database.OLEDB(btFormat.DatabaseConnections[0].Name);
btdb.SQLStatement = "SELECT `Model`, `Year` FROM `Sheet1$`";
btFormat.DatabaseConnections.SetDatabaseConnection(btdb);
[/code]
0
Avatar
Legacy Poster
評論操作 永久連結

Thank you

登入寫評論。