How To Set A Sql Statement To Labelformatdocument Object?
Hi,
I refer the BarTender .net sdks docs, the sample code is :
((OLEDB)btFormat.DatabaseConnections[0]).SQLStatement = SQL;
But in my visual studio envirment, can't find the "OLEDB" class, even using namespace System.Data &
System.Data.OleDb .
I used Visual Studio 2010 professional, in WINDOWS 7 X64 ULTIMATE.
Anybody can tell me how to do ? Thanks a lot~~!
-
From BarTender's Help, you can see the instructions needed for compiling your first .NET SDK application:
Beginning a Visual Studio Project with the Print SDKTo begin a BarTender Print SDK project in Visual Studio 2005 or higher:
-
From the File menu, select New and click
Project. -
In the Project types panel, under either the Visual
C# or the Visual Basic node, select Windows. -
In the Templates panel, select Windows
Application. -
Name the project and click OK.
After the project is created, add a reference to
Seagull.BarTender.Print.-
In the Solution Explorer panel, right-click
on the References node and select Add
Reference from the context menu. -
In the Add Reference window, select the
.NET tab, select Seagull.BarTender.Print, and
click OK.
Make sure the project is able to build and compile by pressing
Ctrl+Shift+B. If successful, you are ready to begin your first
BarTender Print SDK project.You could now set your OLEDB statement by using the following code (for C#.Net):
string SQL = "SELECT `Calories` FROM `NutritionInformation`";
Engine btEngine = new Engine();
LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\NutritionLabel.btw");
((OLEDB)btFormat.DatabaseConnections[0]).SQLStatement = SQL;
Does this help or will you still be stuck?
0 -
I found must add reference the namespace "Seagull.BarTender.Print.Database" ( NOT the "Seagull.BarTender.Print") so that to find the "OLEDB" class.
Thank you for you help~~!!
0
请先登录再写评论。
评论
2 条评论